public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved
@ 2003-05-09 19:01 giovannibajo
  0 siblings, 0 replies; 4+ messages in thread
From: giovannibajo @ 2003-05-09 19:01 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, giovannibajo, nobody

Synopsis: [diagnostic] Error message for function declarations with invalid return type could be improved

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: bajo
Responsible-Changed-When: Fri May  9 19:01:06 2003
Responsible-Changed-Why:
    Diagnostic mantainer

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10618


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved
@ 2003-05-05 14:43 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-05-05 14:43 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, giovannibajo, nobody

Synopsis: [diagnostic] Error message for function declarations with invalid return type could be improved

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon May  5 14:43:43 2003
State-Changed-Why:
    Agreed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10618


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved
@ 2003-05-05 10:26 Giovanni Bajo
  0 siblings, 0 replies; 4+ messages in thread
From: Giovanni Bajo @ 2003-05-05 10:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10618; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	"Giovanni Bajo" <giovannibajo@libero.it>
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 <class>
 struct Foo
 {
     typedef int int_type;
 };
 
 
 template <class T>
 Foo<T>::int_type<T> func1(Foo<T>::int_type c)
 {}
 
 template <class T>
 Foo<T>::template int_type<T> func2(Foo<T>::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<<unnamed>>::int_type" may not have a
           template argument list
   Foo<T>::int_type<T> func1(Foo<T>::int_type c)
           ^
 
 "pr9175.cpp", line 9: error: nontype
           "Foo<<unnamed>>::int_type [with <unnamed>=T]" is not a template
   Foo<T>::int_type<T> func1(Foo<T>::int_type c)
           ^
 
 "pr9175.cpp", line 9: error: nontype
           "Foo<<unnamed>>::int_type [with <unnamed>=T]" is not a type name
   Foo<T>::int_type<T> func1(Foo<T>::int_type c)
                             ^
 
 "pr9175.cpp", line 13: warning: name following "template" must be a member
           template
   Foo<T>::template int_type<T> func2(Foo<T>::int_type c)
                    ^
 
 
 "pr9175.cpp", line 13: error: type "Foo<<unnamed>>::int_type" may not have a
           template argument list
   Foo<T>::template int_type<T> func2(Foo<T>::int_type c)
                    ^
 
 "pr9175.cpp", line 13: error: template
           "Foo<<unnamed>>::int_type [with <unnamed>=T]" is not a type name
   Foo<T>::template int_type<T> func2(Foo<T>::int_type c)
   ^
 
 "pr9175.cpp", line 13: error: nontype
           "Foo<<unnamed>>::int_type [with <unnamed>=T]" is not a type name
   Foo<T>::template int_type<T> func2(Foo<T>::int_type c)
                                      ^
 
 
 Giovanni Bajo
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved
@ 2003-05-04 10:16 giovannibajo
  0 siblings, 0 replies; 4+ messages in thread
From: giovannibajo @ 2003-05-04 10:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10618
>Category:       c++
>Synopsis:       [diagnostic] Error message for function declarations with invalid return type could be improved
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun May 04 10:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Giovanni Bajo
>Release:        3.4 CVS 20030503
>Organization:
>Environment:
i686-pc-cygwin
>Description:
Look at this:

---------------------------------------
template <class T>
struct A
{
};

struct B
{
};


template <class T> 
A<T>::k func1(); 

B::k func2();
---------------------------------------
pr10615.cpp:12: error: expected function-definition
pr10615.cpp:14: error: expected constructor, destructor, or type conversion
pr10615.cpp:14: error: expected `,' or `;'

(note: this code ICEs on 3.3, but there's already a PR for it, c++/10617)

I think the error message should be improved since it is
a bit confusing right now. This is for instance what I get with Comeau/EDG on the same snippet:


"pr10615.cpp", line 12: error: nontype "A<T>::k [with T=T]" is not a type name
  A<T>::k func1();
  ^

"pr10615.cpp", line 14: error: class "B" has no member "k"
  B::k func2();
     ^
>How-To-Repeat:
Compile the above code
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-09 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09 19:01 c++/10618: [diagnostic] Error message for function declarations with invalid return type could be improved giovannibajo
  -- strict thread matches above, loose matches on Subject: below --
2003-05-05 14:43 bangerth
2003-05-05 10:26 Giovanni Bajo
2003-05-04 10:16 giovannibajo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).