Debian Codegraph @

gcc/testsuite/g++.dg/ext/visibility/anon6.C

raw
1 // PR c++/33094
2 // { dg-final { scan-assembler "1BIiE1cE" } }
3 // { dg-final { scan-assembler-not "globl.*1BIiE1cE" } }
4 // { dg-final { scan-assembler-not "comdat" } }
5 // { dg-final { scan-assembler-not "weak" } }
6 // { dg-final { scan-assembler-not "1AIiE1cE" } }
7
8 // Test that B<int>::c is emitted as an internal symbol, and A<int>::c is
9 // not emitted.
10
11 namespace
12 {
13 template <typename T>
14 class A
15 {
16 virtual T f1() { return c; }
17 static const T c = 0;
18 };
19
20 template <typename T>
21 class B
22 {
23 __attribute__ ((__used__)) static const T c = 0;
24 };
25
26 template <typename T> const T B<T>::c;
27
28 template class A<int>;
29 template class B<int>;
30 }