PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / spec35.C
blobe82323ce448f219bb8d6a99f4a0927bba88777c8
1 // PR c++/31923
2 // C++ DR 605 -- "...the linkage of an explicit specialization must be that of
3 // the template."
5 // { dg-do compile { target i?86-*-* x86_64-*-* } }
6 // { dg-require-weak "" }
8 template<class T>
9 static void f1 (T) { }
11 // { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IfEvT_" } }
12 template<>
13 void f1<float> (float) { }  // Expected to have static linkage
15 template<class T>
16 void f2 (T) { }
18 // { dg-final { scan-assembler ".glob(a|)l\[\t \]*_?_Z2f2IfEvT_" } }
19 template<>
20 void f2<float> (float) { }  // Expected to have global linkage
22 void instantiator ()
24   // { dg-final { scan-assembler-not ".glob(a|)l\[\t \]*_?_Z2f1IiEvT_" } }
25   f1(0);  // Expected to have static linkage
27   // { dg-final { scan-assembler ".weak(_definition)?\[\t \]*_?_Z2f2IiEvT_" { target { ! { *-*-mingw* *-*-cygwin } } } } }
28   f2(0);  // Expected to have weak global linkage