This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cvs: ICE on using using


Hi Markus,

your example is ill-formed. Let's consider an slightly shortened
version:

------------------------snip here-------------------------
class C
{
    enum Enum { one, too, tree };
};

template <class T>
struct Test
{
    void DoSomething() { using T::one; }
};
------------------------snip here-------------------------

If you want to import a name from a class (and not a namespace),
this class has to be a base class, and the using declaration must be
in class scope. Thus, a corrected version could be:

------------------------snip here-------------------------
class C
{
    enum Enum { one, too, tree };
};

template <class T>
struct Test : T
{
    using T::one;
    void DoSomething() { }
};
------------------------snip here-------------------------

which compiles with gcc 3.2, 3.3 and mainline.

Since an ICE is a bug nevertheless, I'll file a PR anyway.

Regards,
Volker



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]