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

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).