This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34920] New: Members in nameless union
- From: "extronus at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2008 05:03:35 -0000
- Subject: [Bug c++/34920] New: Members in nameless union
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Members in nameless union defined in template base class cannot be accessed by
template derived class. Methods in base class can access members.
Tried on 3.4.5 (mingw) and 4.1.2 (gentoo)
Simplified code :
template <typename TYPE>
class base
{
public :
typedef TYPE arrayType1[4];
typedef TYPE arrayType2[2][2];
union {
arrayType1 o; ///< One dimensional array
arrayType2 t; ///< Two dimensional array
struct
{
TYPE m11; TYPE m12; TYPE m13; TYPE m14;
};
};
void base_funk()
{
o[0] = 0;
}
};
template <typename TYPE>
class derived : public base<TYPE>
{
public :
void der_funk(TYPE v) {o[0] = v;}
};
--
Summary: Members in nameless union
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: extronus at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34920