From -5295776720437234848 X-Google-Thread: 7894ca11fe,40de2bc986604261 X-Google-Attributes: gid7894ca11fe,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 04 Oct 2009 00:30:02 -0500 Return-Path: To: (Usenet) From: Florian Weimer Newsgroups: comp.std.c++ Subject: Re: Templates as default arguments Organization: unknown Sender: cppmods@cs.rpi.edu Approved: james.dennett@gmail.com Message-ID: <87ab083m7u.fsf@mid.deneb.enyo.de> References: Content-Type: text/plain; charset=us-ascii X-Original-Date: Sat, 03 Oct 2009 08:39:33 +0000 X-Submission-Address: std-c++@netlab.cs.rpi.edu Date: Sun, 4 Oct 2009 00:16:30 CST Lines: 28 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-CkK38Cc9ju3LQ8+yesICMGsf6tRw+ivu1JgRUKZ4QWlZ2o78eP3a5Tptb1Bzyxn2043pNiNGv+HmWts!zQBrrYrQxxvWGtqZmXvECu5rXRr2kgUDC0KApSQmMsKNi6o7NyChW8WvqOA= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: g2news2.google.com comp.std.c++:1423 * dps: > Hi, > > I have the following situation: > > template class A > { > A(){} > }; > > class B > { > public: > B(A arg=A()){} > } > > The above is pseudo-code and compiles on VS but not on gcc. With struct instead of class and an additional semicolon, it compiles with GCC 4.4. It's presumably a bug in earlier versions. -- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]