summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-2.C
blob: ed38ebefe9dde2cc0993a76b773bbb34e1611124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test that -fvisibility-inlines-hidden doesn't affect static variables. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-options "-fvisibility-inlines-hidden" } */
/* { dg-final { scan-not-hidden "_ZZN3foo7my_funcEvE1x" } } */

struct foo 
{
  int my_func() {
    static int x;
    return x++;
  }
};

int t() 
{
  foo f;
  return f.my_func();
}