From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21279 invoked by alias); 18 Jan 2005 09:15:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21256 invoked by uid 48); 18 Jan 2005 09:15:28 -0000 Date: Tue, 18 Jan 2005 09:15:00 -0000 From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050118091525.19499.reichelt@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg02371.txt.bz2 List-Id: The diagnostic for the following invalid code snippet could be improved: ================================= template struct A {}; namespace N {} A 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