summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/visibility/local1.C
blob: 7a04db601154afff111900f34d8784f71326698c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR c++/19238
// Test that hidden visibility on an inline function is inherited by static
// local variables and local classes.

// { dg-require-visibility "" }
// { dg-final { scan-hidden "_Z1fv" } }
// { dg-final { scan-hidden "_ZZ1fvE1i" } }
// { dg-final { scan-hidden "_ZZ1fvEN1A1fEv" } }

__attribute ((visibility ("hidden"))) inline int
f()
{
  static int i = 2;
  struct A
  {
    void f () { }
  } a;
  a.f();
  return i;
}

int main()
{
  f();
}