[Bug c++/54158] New: Silently accepts sizeof to non-static member without object in C++03 mode
ai.azuma at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 2 02:41:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54158
Bug #: 54158
Summary: Silently accepts sizeof to non-static member without
object in C++03 mode
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ai.azuma@gmail.com
The following code is not well-formed in C++03.
/////////////////////////////
struct Class
{
int Member;
};
int i[sizeof(Class::Member)];
/////////////////////////////
However, GCC 4.6.4 20120727, 4.7.2 20120728 and 4.8.0 20120729 accept this code
without any warning, even with `-std=c++03', `-Wall' and `-pedantic'.
More information about the Gcc-bugs
mailing list