gcc/testsuite/g++.dg/init/member1.C
raw| 1 | // Copyright (C) 2005 Free Software Foundation, Inc. |
| 2 | // Contributed by Nathan Sidwell 13 Jun 2005 <[email protected]> |
| 3 | |
| 4 | // Origin: Ivan Godard <[email protected]> |
| 5 | // Bug 20789: ICE on invalid |
| 6 | |
| 7 | template<typename> struct A; |
| 8 | |
| 9 | template<int> struct B {}; |
| 10 | |
| 11 | template<typename T> struct C |
| 12 | { |
| 13 | static const int i = A<T>::i; // { dg-error "incomplete" } |
| 14 | static const int j = i; |
| 15 | B<j> b; |
| 16 | }; |
| 17 | |
| 18 | C<int> c; |
| 19 | |
| 20 | int i = C<int>::i; |
| 21 | int j = C<int>::j; |