From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20430 invoked by alias); 23 Jan 2003 05:36:00 -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 20416 invoked by uid 71); 23 Jan 2003 05:36:00 -0000 Date: Thu, 23 Jan 2003 05:36:00 -0000 Message-ID: <20030123053600.20415.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Philippe A. Bouchard" Subject: Re: c++/7136: Template constants deduction Reply-To: "Philippe A. Bouchard" X-SW-Source: 2003-01/txt/msg01335.txt.bz2 List-Id: The following reply was made to PR c++/7136; it has been noted by GNATS. From: "Philippe A. Bouchard" To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, philippeb@videotron.ca, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/7136: Template constants deduction Date: Thu, 23 Jan 2003 00:29:38 -0500 Yes you're right but the following won't work either under gcc 2.95: struct Type { int i; }; template struct Number {}; template void foo(Number<_T, _I> const &) { } int main() { foo(Number()); } Returns: template.cpp: In function `int main()': template.cpp:15: no matching function for call to `foo (Number)' Philippe ----- Original Message ----- From: To: ; ; ; Sent: Wednesday, January 22, 2003 10:16 PM Subject: Re: c++/7136: Template constants deduction > 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 > struct Number {}; > > template > void foo(Number<_T, int _T::*> const &) > {} > > int main() { > foo(Number()); > } > ------------------------------ > > 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&p r=7136 >