Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/linkage1.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // PR c++/50372 |
2 // Test that a template instantiation has the same linkage as its argument. | |
3 // { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z3fooIXadL_Z13external_funcvEEEvv" } } | |
4 // { dg-final { scan-assembler-not "(weak|glob)\[^\n\]*_Z3fooIXadL_ZL11static_funcvEEEvv" { xfail powerpc-*-aix* } } } | |
5 | |
6 template<void (*fptr)(void)> | |
7 void foo() { } | |
8 | |
9 static void static_func() {} | |
10 void external_func() { } | |
11 | |
12 void test() | |
13 { | |
14 #if __cplusplus > 199711L | |
15 foo<&static_func>(); | |
16 #endif | |
17 foo<&external_func>(); | |
18 } |