This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21120] New: Empty declaration with typeof accepted
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Apr 2005 09:56:18 -0000
- Subject: [Bug c++/21120] New: Empty declaration with typeof accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The error message "declaration does not declare anything" is not
triggered in certain cases when using typeof:
===================================
struct A {};
void foo() { typeof(A); }
===================================
It *is* triggered if I write typeof(int) instead.
Another testcase is the following:
===================================
template<int> struct A
{
void foo() { typeof(this); }
};
===================================
Even when I use foo(), the error message is not triggered.
It *is* triggered if I make A a non-template class.
Btw, before 4.0 we even used to crash on the second testcase
- see PR 2703 - but a testcase never made it to the testsuite.
--
Summary: Empty declaration with typeof accepted
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: accepts-invalid, 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=21120