This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7703: [2003-01-28] gcc gives parse errors when compiling a class function with recursively templated default value for a function parameter
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 2 May 2003 01:26:00 -0000
- Subject: Re: c++/7703: [2003-01-28] gcc gives parse errors when compiling a class function with recursively templated default value for a function parameter
- Reply-to: "Giovanni Bajo" <giovannibajo at libero dot it>
The following reply was made to PR c++/7703; it has been noted by GNATS.
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
<gcc-bugs@gcc.gnu.org>,
<nobody@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>,
<fizban@umich.edu>
Cc:
Subject: Re: c++/7703: [2003-01-28] gcc gives parse errors when compiling a class function with recursively templated default value for a function parameter
Date: Fri, 2 May 2003 03:19:25 +0200
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7703
This is only about the comma in the default parameter:
-----------------------------
template <class, class>
struct Bar
{};
template <class>
struct Foo
{
void func(Bar<void, void> b = Bar<void, void>())
{
}
};
template struct Foo<void>;
-----------------------------
pr7703.cpp:8: error: variable or field `func' declared void
pr7703.cpp:8: error: expected function-definition
I'm confident this is a duplicate but I could not find the other PR.
The obvious workaround is just to put a couple of parenthesis around the
default parameter to disambiguate the parser (which is confused by the
comma).
Since this is one of the points discussed in DR325, I suspend this PR till
the resolution of the defect report.
Giovanni Bajo