gcc/testsuite/g++.old-deja/g++.ext/noweak1.C
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-fno-weak" } |
| 3 | // Test that -fno-weak doesn't break explicit instantiation of static data. |
| 4 | |
| 5 | template <class T> struct A |
| 6 | { |
| 7 | static int i; |
| 8 | }; |
| 9 | |
| 10 | template <class T> int A<T>::i = 42; |
| 11 | |
| 12 | template class A<int>; |
| 13 | |
| 14 | int main () |
| 15 | { |
| 16 | return (A<int>::i != 42); |
| 17 | } |