[Bug c++/11487] New: g++ accepts non-type as type in declaration
hans dot ekkehard dot plesser at nlh dot no
gcc-bugzilla@gcc.gnu.org
Thu Jul 10 10:39:00 GMT 2003
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.
More information about the Gcc-bugs
mailing list