view gcc/testsuite/g++.dg/ext/visibility/ref-temp1.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/91476
// Test that hidden and internal visibility propagates to reference temps.

#define HIDDEN __attribute((visibility("hidden")))

// { dg-final { scan-hidden "_ZGRZ1fvE3foo_" } }
HIDDEN inline const int* f() { static const int &foo = 1; return &foo; }

// { dg-final { scan-assembler-not "(weak|globl)\[^\n\]*_ZGRN12_GLOBAL__N_13fooE_" } }
namespace { const int &foo = 1; }

const void *volatile p;
int main()
{
  p = f();
  p = &foo;
}