public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11815] New: ICE with missing template keyword
@ 2003-08-05 23:16 reichelt at gcc dot gnu dot org
2003-08-05 23:23 ` [Bug c++/11815] " reichelt at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-08-05 23:16 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11815
Summary: ICE with missing template keyword
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
This is a spin-off from PR 6023:
Consider the following invalid code (which is missing a "template"
keyword righ before "X" in line 5):
-------------------------------------------
template <typename> struct A;
template <typename T> struct B
{
template <int> void foo(const typename A<T>::X<T,T>::Y&);
template <typename U> void bar(U x) { foo<0>(x); }
};
-------------------------------------------
Compiling this with mainline, one gets the following error message:
bug.cc:5: error: expected primary-expression
bug.cc:5: error: expected primary-expression
bug.cc:5: error: `::Y' has not been declared
bug.cc:5: error: expected primary-expression
bug.cc:5: error: variable or field `foo' declared void
bug.cc:5: error: ISO C++ forbids initialization of member `foo'
bug.cc:5: error: making `foo' static
bug.cc:5: error: ISO C++ forbids in-class initialization of non-const static
member `foo'
bug.cc:5: error: template declaration of `int B<T>::foo'
bug.cc: In member function `void B<T>::bar(U)':
bug.cc:6: internal compiler error: in cp_parser_template_id, at cp/parser.c:
7516
Please submit a full bug report, [etc.]
This is rewarded with three keywords: "ice-on-invalid-code",
"error-recovery" (since the ICE happens after a error message),
and "diagnostic" (since the error message is not very helpful -
we are missing just one "template", remember).
Nevertheless, this is actually an improvement since the code was wrongly
accepted by gcc 2.95.x - 3.3.x.
Btw, by varying the declaration of foo (i.e. removing "&", "const", or "::Y")
one can change the error message a little.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/11815] ICE with missing template keyword
2003-08-05 23:16 [Bug c++/11815] New: ICE with missing template keyword reichelt at gcc dot gnu dot org
@ 2003-08-05 23:23 ` reichelt at gcc dot gnu dot org
2003-08-05 23:28 ` pinskia at physics dot uc dot edu
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-08-05 23:23 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11815
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |6023
nThis| |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/11815] ICE with missing template keyword
2003-08-05 23:16 [Bug c++/11815] New: ICE with missing template keyword reichelt at gcc dot gnu dot org
2003-08-05 23:23 ` [Bug c++/11815] " reichelt at gcc dot gnu dot org
@ 2003-08-05 23:28 ` pinskia at physics dot uc dot edu
2003-08-23 1:10 ` dhazeghi at yahoo dot com
2003-12-02 10:02 ` reichelt at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-05 23:28 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11815
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-05 23:28:53
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-08-05 23:28 -------
I can confirm this on the mainline (20030805).
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/11815] ICE with missing template keyword
2003-08-05 23:16 [Bug c++/11815] New: ICE with missing template keyword reichelt at gcc dot gnu dot org
2003-08-05 23:23 ` [Bug c++/11815] " reichelt at gcc dot gnu dot org
2003-08-05 23:28 ` pinskia at physics dot uc dot edu
@ 2003-08-23 1:10 ` dhazeghi at yahoo dot com
2003-12-02 10:02 ` reichelt at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 1:10 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11815
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/11815] ICE with missing template keyword
2003-08-05 23:16 [Bug c++/11815] New: ICE with missing template keyword reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2003-08-23 1:10 ` dhazeghi at yahoo dot com
@ 2003-12-02 10:02 ` reichelt at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-12-02 10:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2003-12-02 10:02 -------
Fixed by Mark's patch for PR9849.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11815
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-12-02 10:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-05 23:16 [Bug c++/11815] New: ICE with missing template keyword reichelt at gcc dot gnu dot org
2003-08-05 23:23 ` [Bug c++/11815] " reichelt at gcc dot gnu dot org
2003-08-05 23:28 ` pinskia at physics dot uc dot edu
2003-08-23 1:10 ` dhazeghi at yahoo dot com
2003-12-02 10:02 ` reichelt at gcc dot gnu dot org
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).