This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17421] New: g++ accepts invalid qualified declarator-id
- From: "ppluzhnikov at charter dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2004 19:29:46 -0000
- Subject: [Bug c++/17421] New: g++ accepts invalid qualified declarator-id
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This is similar to, but not exactly like, bug 16782
$ cat junk.cc
void ::foo() { }
$ /usr/local/gcc-3.4.2/bin/g++ -c junk.cc -Wall
$ edgcpfe junk.cc
"junk.cc", line 1: error: the global scope has no "foo"
void ::foo() { }
^
1 error detected in the compilation of "junk.cc".
The Standard (ISO+IEC+14882-1998) says in 8.3 paragraph 1:
When the declarator-id is qualified,
the declaration shall refer to a previously declared member of the
class or namespace to which the qualifier refers, and the member
shall not have been introduced by a usingdeclaration in the scope
of the class or namespace nominated by the nested-name-specifier of
the declarator-id.
--
Summary: g++ accepts invalid qualified declarator-id
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ppluzhnikov at charter dot net
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=17421