comparison gcc/testsuite/g++.dg/ext/visibility/ref-temp1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/91476
2 // Test that hidden and internal visibility propagates to reference temps.
3
4 #define HIDDEN __attribute((visibility("hidden")))
5
6 // { dg-final { scan-hidden "_ZGRZ1fvE3foo_" } }
7 HIDDEN inline const int* f() { static const int &foo = 1; return &foo; }
8
9 // { dg-final { scan-assembler-not "(weak|globl)\[^\n\]*_ZGRN12_GLOBAL__N_13fooE_" } }
10 namespace { const int &foo = 1; }
11
12 const void *volatile p;
13 int main()
14 {
15 p = f();
16 p = &foo;
17 }