From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4131 invoked by alias); 3 Feb 2004 20:29:42 -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 4121 invoked by uid 48); 3 Feb 2004 20:29:42 -0000 Date: Tue, 03 Feb 2004 20:29:00 -0000 From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040203202940.14008.reichelt@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/14008] New: Confusing diagnostic when ommitting a template parameter X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg00437.txt.bz2 List-Id: Here are two invalid code snippets where gcc gives misleading diagnostic: ================================================= namespace N { template struct A {}; } struct B { N::A a; }; ================================================= With mainline I get bug1.cc:8: error: using-declaration for non-member at class scope bug1.cc:8: error: expected `;' before "a" but I fail to see a using declaration in the code. If I write "typename N::A a;" instead and make "struct B" a template like so ================================================= namespace N { template struct A {}; } template struct B { typename N::A a; }; ================================================= I get bug2.cc:8: error: no class template named `A' in `N' bug2.cc:8: error: ISO C++ forbids declaration of `a' with no type which is equally confusing, since 'A' *is* a class template in 'N'. -- Summary: Confusing diagnostic when ommitting a template parameter Product: gcc Version: 3.4.0 Status: UNCONFIRMED Keywords: 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 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14008