public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
@ 2005-01-18  9:15 reichelt at gcc dot gnu dot org
  2005-01-18  9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-18  9:15 UTC (permalink / raw)
  To: gcc-bugs

The diagnostic for the following invalid code snippet could be improved:

=================================
template<typename> struct A {};

namespace N {}

A<N> a;
=================================

On mainline we now get:

bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: expected constructor, destructor, or type conversion before
'<' token

With 3.3.5 we get:

bug5.cc:5: error: use of namespace `N' as expression
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: ISO C++ forbids declaration of `a' with no type

which is okay IMHO. With 3.4.3 we get

bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: invalid type in declaration before ';' token

which is less informative, but still okay.
With the current 3.4 branch we almost get the same mess as with mainline.

-- 
           Summary: [3.4/4.0 regression] Bad diagnostic for namespace as
                    template parameter
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic, monitored
          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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499


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

end of thread, other threads:[~2005-02-01 10:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18  9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
2005-01-18  9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
2005-01-18 14:39 ` pinskia at gcc dot gnu dot org
2005-01-31  6:26 ` mmitchel at gcc dot gnu dot org
2005-02-01  5:57 ` cvs-commit at gcc dot gnu dot org
2005-02-01  7:04 ` cvs-commit at gcc dot gnu dot org
2005-02-01 10:50 ` 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).