This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ bug


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]