gcc/testsuite/g++.old-deja/g++.pt/sizeof3.C
raw| 1 | // { dg-do run } |
| 2 | // Adapted from testcase by Oskar Enoksson <[email protected]> |
| 3 | |
| 4 | extern "C" void abort(); |
| 5 | |
| 6 | template<class T0> |
| 7 | class A { |
| 8 | public: |
| 9 | typedef T0 T; |
| 10 | }; |
| 11 | |
| 12 | template<int K> |
| 13 | class B { |
| 14 | typedef A<char[K]> BC; |
| 15 | }; |
| 16 | |
| 17 | template<int N, int M> |
| 18 | class C { |
| 19 | public: |
| 20 | typedef A<char[M]> AC; |
| 21 | }; |
| 22 | |
| 23 | int main() { |
| 24 | if (sizeof(C<3,7>::AC::T) != 7) |
| 25 | abort(); |
| 26 | } |