This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cvs: ICE on using using
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: numerical dot simulation at web dot de
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 31 Jan 2003 19:59:06 +0100
- Subject: 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