From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28623 invoked by alias); 5 May 2003 10:26: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 28609 invoked by uid 71); 5 May 2003 10:26:00 -0000 Date: Mon, 05 May 2003 10:26:00 -0000 Message-ID: <20030505102600.28608.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved Reply-To: "Giovanni Bajo" X-SW-Source: 2003-05/txt/msg00268.txt.bz2 List-Id: The following reply was made to PR c++/10618; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , "Giovanni Bajo" Cc: Subject: Re: c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved Date: Mon, 5 May 2003 12:25:36 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10618 I add the following snippet to this PR (was c++/9175), since it's a very similar situation: ------------------------------------------------------------------ template struct Foo { typedef int int_type; }; template Foo::int_type func1(Foo::int_type c) {} template Foo::template int_type func2(Foo::int_type c) {} ------------------------------------------------------------------ pr9175.cpp:9: error: expected function-definition pr9175.cpp:13: error: expected function-definition FYI, Comeau gives: "pr9175.cpp", line 9: error: type "Foo<>::int_type" may not have a template argument list Foo::int_type func1(Foo::int_type c) ^ "pr9175.cpp", line 9: error: nontype "Foo<>::int_type [with =T]" is not a template Foo::int_type func1(Foo::int_type c) ^ "pr9175.cpp", line 9: error: nontype "Foo<>::int_type [with =T]" is not a type name Foo::int_type func1(Foo::int_type c) ^ "pr9175.cpp", line 13: warning: name following "template" must be a member template Foo::template int_type func2(Foo::int_type c) ^ "pr9175.cpp", line 13: error: type "Foo<>::int_type" may not have a template argument list Foo::template int_type func2(Foo::int_type c) ^ "pr9175.cpp", line 13: error: template "Foo<>::int_type [with =T]" is not a type name Foo::template int_type func2(Foo::int_type c) ^ "pr9175.cpp", line 13: error: nontype "Foo<>::int_type [with =T]" is not a type name Foo::template int_type func2(Foo::int_type c) ^ Giovanni Bajo