public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17634] New: default arguments not permitted in typedef's
@ 2004-09-23 13:55 papadopo at shfj dot cea dot fr
  2004-09-23 14:02 ` [Bug c++/17634] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-09-23 13:55 UTC (permalink / raw)
  To: gcc-bugs

The following used to compile in gcc 3.3:
	$ cat foo.cc
	typedef void (*Function)(int n = 1);
	$ g++ -c foo.cc
	$ 

It doesn't compile anymore in gcc 3.4:
	$ cat foo.cc
	typedef void (*Function)(int n = 1);
	$ g++ -c foo.cc
	foo.cc:1: error:
	default arguments are only permitted for function parameters
	$ 


Although I'm not sure this is legal C++, I've opened a bug report because the
following does work with gcc 3.4, which seems inconsistent:
	$ cat foo.cc
	struct MyClass {
	    typedef void (MyClass::*Function)(int n = 1);
	};
	$ g++ -c foo.cc
	$

-- 
           Summary: default arguments not permitted in typedef's
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: papadopo at shfj dot cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17634


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-23 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-23 13:55 [Bug c++/17634] New: default arguments not permitted in typedef's papadopo at shfj dot cea dot fr
2004-09-23 14:02 ` [Bug c++/17634] " pinskia at gcc dot gnu dot org
2004-09-23 14:14 ` schwab at suse dot de
2004-09-23 14:55 ` papadopo at shfj dot cea dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).