| 1 |
// PR c++/26256 |
| 2 |
// { dg-do run } |
| 3 |
|
| 4 |
struct A |
| 5 |
{ |
| 6 |
typedef int type; |
| 7 |
}; |
| 8 |
|
| 9 |
struct B |
| 10 |
{ |
| 11 |
typedef double type; |
| 12 |
}; |
| 13 |
|
| 14 |
struct C : A, B |
| 15 |
{ |
| 16 |
using A::type; |
| 17 |
type d; |
| 18 |
|
| 19 |
void f() |
| 20 |
{ |
| 21 |
type e; |
| 22 |
if (sizeof (type) != sizeof (A::type)) |
| 23 |
__builtin_abort(); |
| 24 |
} |
| 25 |
|
| 26 |
void g(); |
| 27 |
}; |
| 28 |
|
| 29 |
void C::g() |
| 30 |
{ |
| 31 |
type x; |
| 32 |
if (sizeof (type) != sizeof (A::type)) |
| 33 |
__builtin_abort(); |
| 34 |
} |
| 35 |
|
| 36 |
int main () |
| 37 |
{ |
| 38 |
if (sizeof (C::type) != sizeof (A::type)) |
| 39 |
__builtin_abort(); |
| 40 |
|
| 41 |
if (sizeof (C::d) != sizeof (A::type)) |
| 42 |
__builtin_abort(); |
| 43 |
|
| 44 |
C::type x; |
| 45 |
C c; |
| 46 |
c.f(); |
| 47 |
c.g(); |
| 48 |
} |