strub: enable conditional support
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr68064.C
blob59b68973f38bfd0163dccf020504eb273df099cc
1 // { dg-do compile }
3 template <class Config> class A {
4 public:
5   class B;
6   typedef typename Config::template D<A>::type TypeHandle;
7   static A *Tagged() { return B::New(B::kTagged); }
8   static TypeHandle Union(TypeHandle);
9   static TypeHandle Representation(TypeHandle, typename Config::Region *);
10   bool Is();
13 template <class Config> class A<Config>::B {
14   friend A;
15   enum { kTaggedPointer = 1 << 31, kTagged = kTaggedPointer };
16   static A *New(int p1) { return Config::from_bitset(p1); }
19 struct C {
20   typedef int Region;
21   template <class> struct D { typedef A<C> *type; };
22   static A<C> *from_bitset(unsigned);
24 A<C> *C::from_bitset(unsigned p1) { return reinterpret_cast<A<C> *>(p1); }
26 namespace {
27 int *a;
28 void fn1(A<C> *p1) { A<C>::Union(A<C>::Representation(p1, a)); }
31 void fn2() {
32   A<C> b;
33   A<C> *c = b.Is() ? 0 : A<C>::Tagged();
34   fn1(c);