This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11487] New: g++ accepts non-type as type in declaration
- From: "hans dot ekkehard dot plesser at nlh dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2003 10:39:04 -0000
- Subject: [Bug c++/11487] New: g++ accepts non-type as type in declaration
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11487
Summary: g++ accepts non-type as type in declaration
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hans dot ekkehard dot plesser at nlh dot no
CC: gcc-bugs at gcc dot gnu dot org
g++ (tested 2.95.3, 3.1, 3.2, 3.3) compiles the following code without warning:
---------------------
class foo {
public:
foo() {};
};
foo a; // legal
foo::foo b; // illegal
foo::foo::foo c; // illegal
---------------------
IMHO, g++ should reject the definitions of both b and c, since neither foo::foo
nor foo::foo::foo are types.