This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: g++ bug
- From: Greg Chicares <gchicares at sbcglobal dot net>
- To: cygwin at cygwin dot com
- Date: Sun, 16 Sep 2007 19:51:13 +0000
- Subject: Re: g++ bug
- References: <46ED3A34.2000903@sensi.org>
ICE on invalid code.
On 2007-09-16 14:14Z, Alexander Favorov wrote:
>
> typedef enum {unknown_output=-1,text_output=0,comment_output=1,html_output=2} output_mode_type;
'::text_output' is an enumerator.
> class Diagnostics:public ostringstream
> {
...
> public:
> output_mode_type output_mode;
> Diagnostics(output_mode_type o_mode);
> void text_output(ostream &)const;
'Diagnostics::text_output' is a member function.
...
> };
>
> inline Diagnostics::Diagnostics(output_mode_type o_mode=text_output):
^^^^^^^^^^^
> output_mode(o_mode){};
Which 'text_output'?
A later gcc version gives:
In file included from DiagnosticsTest.cpp:6:
Diagnostics.hpp:29: error: default argument for 'output_mode_type o_mode'
has type '<unresolved overloaded function type>'
To confirm that the code is erroneous, use
http://www.comeaucomputing.com/tryitout/
which will tell you about some other problems that
'g++ -W -Wall -std=c++98 -pedantic' would report as well.
To fix the reported error:
- inline Diagnostics::Diagnostics(output_mode_type o_mode=text_output):
+ inline Diagnostics::Diagnostics(output_mode_type o_mode=::text_output):
^^
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/