This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11993] [3.4 regression] gcc finds passing reference of template argument as template argument invalid


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From stefaandr at hotmail dot com  2003-08-30 10:17 -------
Subject: Re:  [3.4 regression] gcc finds passing reference of template arg

>The standard is very clear about what form a non-type template argument may
>take, and address-of-nontype-template-parameter is not one of the allowed 
>cases.
The same section you reference to contains:
A template-argument for a non-type, non-template template-parameter shall be 
one of:
...
- the address of an object or function with external linkage (excluding 
non-static class-members...), expressed as &id-expression...

For clarity, the code in question is the inheritance part: "public class2 
<&a> {};"
To me, this seems the case above, because I think in the definition of the 
templated class class1, "a" is "the name of an object or function with 
external linkage..." as mentioned in the same paragraph (and I think it must 
be, because you didn't question the definition of class1, and it must comply 
to the same rules in the paragraph).  The fact that the name of any 
non-template parameter is also allowed, doesn't contradict this in my 
opinion.

_________________________________________________________________
MSN 8: Get 6 months for $9.95/month. http://join.msn.com/?page=dept/dialup


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]