public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13407] New: Confusing error message from extraneous typename
@ 2003-12-16 0:03 austern at apple dot com
2003-12-16 8:33 ` [Bug c++/13407] " bangerth at dealii dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: austern at apple dot com @ 2003-12-16 0:03 UTC (permalink / raw)
To: gcc-bugs
Consider the following code sample:
struct A { };
struct B { typedef A Type; };
template <typename T>
struct X : public typename T::Type
{ };
X<B> x;
The mainline compiler gives the following error messages:
bc.cc:5: error: expected class-name
bc.cc:5: error: expected `{'
bc.cc:6: error: expected unqualified-id
bc.cc:6: error: expected `;'
...
An error message is appropriate, since the code really is wrong. However, a naive user (even a
sophisticated user!) would be hard pressed to figure out the real reason for this cascade of errors:
'typename' is forbidden in a base-specifier.
This is a regression from 3.3. The 3.3 error messages were pretty bad too, but at least they gave a
hint that the problem had something to do with 'typename'.
--
Summary: Confusing error message from extraneous typename
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: austern at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
@ 2003-12-16 8:33 ` bangerth at dealii dot org
2003-12-16 17:08 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-12-16 8:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2003-12-16 08:05 -------
Confirmed. I think the error messages of 3.3 and 3.4 are
equally bad, so wouldn't rate this a regression. It would
be nice to have this improved nevertheless.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |gdr at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
GCC build triplet| i686-pc-linux-gnu |i686-pc-linux-gnu
GCC host triplet| i686-pc-linux-gnu |i686-pc-linux-gnu
GCC target triplet| i686-pc-linux-gnu |i686-pc-linux-gnu
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2003-12-16 08:05:03
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
2003-12-16 8:33 ` [Bug c++/13407] " bangerth at dealii dot org
@ 2003-12-16 17:08 ` pinskia at gcc dot gnu dot org
2004-01-16 3:19 ` giovannibajo at libero dot it
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-16 17:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
2003-12-16 8:33 ` [Bug c++/13407] " bangerth at dealii dot org
2003-12-16 17:08 ` pinskia at gcc dot gnu dot org
@ 2004-01-16 3:19 ` giovannibajo at libero dot it
2004-01-16 3:21 ` giovannibajo at libero dot it
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-16 3:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-16 03:19 -------
Mine!
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |giovannibajo at libero dot
|dot org |it
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
` (2 preceding siblings ...)
2004-01-16 3:19 ` giovannibajo at libero dot it
@ 2004-01-16 3:21 ` giovannibajo at libero dot it
2004-01-16 12:29 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-16 3:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-16 03:21 -------
Patch submitted, waiting for review:
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01545.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
` (3 preceding siblings ...)
2004-01-16 3:21 ` giovannibajo at libero dot it
@ 2004-01-16 12:29 ` cvs-commit at gcc dot gnu dot org
2004-01-16 12:33 ` cvs-commit at gcc dot gnu dot org
2004-01-16 12:34 ` giovannibajo at libero dot it
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-16 12:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-01-16 12:29 -------
Subject: Bug 13407
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: giovannibajo@gcc.gnu.org 2004-01-16 12:29:41
Modified files:
gcc/cp : ChangeLog parser.c
Log message:
PR c++/13407
* parser.c (cp_parser_base_specifier): Check for an invalid
keyword 'typename' and emit an user-friendly error message.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3886&r2=1.3887
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.156&r2=1.157
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
` (4 preceding siblings ...)
2004-01-16 12:29 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-16 12:33 ` cvs-commit at gcc dot gnu dot org
2004-01-16 12:34 ` giovannibajo at libero dot it
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-16 12:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-01-16 12:33 -------
Subject: Bug 13407
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: giovannibajo@gcc.gnu.org 2004-01-16 12:33:29
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/parse: typename6.C
Log message:
PR c++/13407
* g++.dg/parse/typename6.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3383&r2=1.3384
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typename6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13407] Confusing error message from extraneous typename
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
` (5 preceding siblings ...)
2004-01-16 12:33 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-16 12:34 ` giovannibajo at libero dot it
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-16 12:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-16 12:34 -------
Fixed in GCC 3.4.0!
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-01-16 12:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-16 0:03 [Bug c++/13407] New: Confusing error message from extraneous typename austern at apple dot com
2003-12-16 8:33 ` [Bug c++/13407] " bangerth at dealii dot org
2003-12-16 17:08 ` pinskia at gcc dot gnu dot org
2004-01-16 3:19 ` giovannibajo at libero dot it
2004-01-16 3:21 ` giovannibajo at libero dot it
2004-01-16 12:29 ` cvs-commit at gcc dot gnu dot org
2004-01-16 12:33 ` cvs-commit at gcc dot gnu dot org
2004-01-16 12:34 ` giovannibajo at libero dot it
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).