From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5036 invoked by alias); 16 Mar 2003 20:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 4979 invoked by uid 71); 16 Mar 2003 20:06:01 -0000 Date: Sun, 16 Mar 2003 20:06:00 -0000 Message-ID: <20030316200601.4978.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/10111: Parse error for default template parameter Reply-To: "Giovanni Bajo" X-SW-Source: 2003-03/txt/msg01082.txt.bz2 List-Id: The following reply was made to PR c++/10111; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , Cc: Subject: Re: c++/10111: Parse error for default template parameter Date: Sun, 16 Mar 2003 21:04:09 +0100 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p r=10111 Not a real bug. All boils down to a definition like this: void Foo(int a = A::something) {} There is an open defect report about this (http://www.comeaucomputing.com/iso/cwg_active.html#325), because (shortly) ISO C++ does not mandate that the compiler must understand that the comma is separating template parameters, and not parameters of the function you are declaring. Simple workaround is putting a couple of paranthesis around the default argument, the code will compile correctly: void Foo(int a = (A::something)) {} Notice that both Comeau and VC7.1 accepts this syntax right now, maybe it could be worth considering adding it as an "extension" to the mainline. I think it's common sense that the code should work. (Another little note is that the code, as submitted, is ill-formed, typename may not be used outside template definitions). Giovanni Bajo