This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/57: [parser] templates in default arguments
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- Cc: nathan at codesourcery dot com, gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Wed, 23 Oct 2002 20:31:03 +0100
- Subject: Re: c++/57: [parser] templates in default arguments
- References: <Pine.LNX.4.44.0210221810390.24206-100000@gandalf.ticam.utexas.edu>
Wolfgang Bangerth wrote:-
>
> Nathan,
> the following code has, if I recall correctly, invalid syntax:
> ---------------------------------------------
> template <class T, class U>
> struct A {
> static const int n = 0;
> };
>
> template <class T>
> struct B
> {
> template <class U>
> void foo (int = A<T, U>::n) { }
> };
> ---------------------------------------------
> In the default argument parsing, there's a "," not nested inside
> parentheses. This stops default argument parsing. If you agree, then this
> report should be closed.
FWIW Comeau accepts it in strict conforming mode.
Neil.