| 1 |
// http://bugzilla.redhat.com/411871 |
| 2 |
// { dg-do compile } |
| 3 |
|
| 4 |
extern "C" int printf (const char *, ...); |
| 5 |
|
| 6 |
struct E |
| 7 |
{ |
| 8 |
template <typename T> E (const volatile T&); |
| 9 |
template <typename T> E (T&); |
| 10 |
char x[64]; |
| 11 |
}; |
| 12 |
|
| 13 |
template<typename T> struct D |
| 14 |
{ |
| 15 |
static E foo (E, ...); |
| 16 |
static int foo (T, int); |
| 17 |
}; |
| 18 |
|
| 19 |
template<typename T, typename U> struct C |
| 20 |
{ |
| 21 |
static T ca; |
| 22 |
static const int value = sizeof (D<U>::foo (ca, 0)) == sizeof (int); |
| 23 |
}; |
| 24 |
|
| 25 |
struct A |
| 26 |
{ |
| 27 |
int a; |
| 28 |
}; |
| 29 |
|
| 30 |
namespace |
| 31 |
{ |
| 32 |
struct B |
| 33 |
{ |
| 34 |
int a; |
| 35 |
}; |
| 36 |
} |
| 37 |
|
| 38 |
int bar (void) |
| 39 |
{ |
| 40 |
C<A, int> a; |
| 41 |
C<B, int> b; |
| 42 |
|
| 43 |
return a.value + b.value; |
| 44 |
} |