[Bug c++/12620] New: compatibility issue with anonymous struct/union support
jbeulich at novell dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 15 12:03:00 GMT 2003
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.
More information about the Gcc-bugs
mailing list