This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7136: Template constants deduction
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, philippeb at videotron dot ca
- Date: 23 Jan 2003 03:16:59 -0000
- Subject: Re: c++/7136: Template constants deduction
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, philippeb at videotron dot ca, gcc-gnats at gcc dot gnu dot org
Synopsis: Template constants deduction
State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 23 03:16:59 2003
State-Changed-Why:
Nathan must have been having his afternoon nap when he
confirmed this report :-)
The code is actually illegal, and gcc tells you quite
correctly what is wrong:
-----------------------------
struct Type { int i; };
template <typename _T, int _T::*>
struct Number {};
template <typename _T, int _T::*>
void foo(Number<_T, int _T::*> const &)
{}
int main() {
foo(Number<Type, &Type::i>());
}
------------------------------
In the argument list to foo(), the second template
parameter to Number is "int T::*", which is a type, not
a value. That's what the compiler is complaining about. In
the call to foo(), the second argument is a value, as it
should be.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7136