This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41796] New: Extended sizeof (referring to non-static member) rises ambiguity
- From: "schaub-johannes at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2009 13:27:40 -0000
- Subject: [Bug c++/41796] New: Extended sizeof (referring to non-static member) rises ambiguity
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code fails for GCC:
struct A { int a; };
struct B : A {};
struct C : A {};
struct D : B, C { };
int main() { (void) sizeof(D::a); }
According to the current draft, such use is correct: Name lookup will resolve
to a single declaration, and sizeof does not make additional constraint with
regard to the subobject to refer to. It is reasonable to suspect a standard
defect - this bug report is supposed to be a reminder in that case.
--
Summary: Extended sizeof (referring to non-static member) rises
ambiguity
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schaub-johannes at web dot de
GCC host triplet: 4.4.1
GCC target triplet: 4.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41796