This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12620] New: compatibility issue with anonymous struct/union support
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2003 12:03:02 -0000
- Subject: [Bug c++/12620] New: compatibility issue with anonymous struct/union support
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12620
Summary: compatibility issue with anonymous struct/union support
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
In
class ccc {
public:
union {
int i;
};
};
all other compilers I can check with (Intel, Microsoft, Borland, MetroWerks)
treat i as a member of ccc. Since the feature is documented to exist for
compatibility reasons, the behavior should be compatible, too.
This can easily be tested with above declaration and the code
template<typename T> void test(T p);
void test() {
test(&ccc::i);
}
by observing what template instantiation is selected by the compiler.