This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51413] New: Broken diagnostic with __builtin_offsetof
- From: "reichelt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Dec 2011 21:57:24 +0000
- Subject: [Bug c++/51413] New: Broken diagnostic with __builtin_offsetof
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51413
Bug #: 51413
Summary: Broken diagnostic with __builtin_offsetof
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: reichelt@gcc.gnu.org
A broken diagnostic is generated for the following invalid code snippet since
GCC 4.1.2:
=============================================
struct A
{
static void foo();
};
int i = __builtin_offsetof(A, foo[1][1]);
=============================================
bug.cc:6:36: warning: pointer to a function used in arithmetic
[-Wpointer-arith]
bug.cc:6:39: warning: pointer to a function used in arithmetic
[-Wpointer-arith]
bug.cc:6:40: error: cannot apply 'offsetof' to member function '#'indirect_ref'
not supported by dump_decl#<declaration error>'