| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-visibility "" } */ |
| 3 |
/* { dg-options "-fvisibility-inlines-hidden" } */ |
| 4 |
/* { dg-final { scan-not-hidden "_ZN1IIiE3fooEv" } } */ |
| 5 |
/* { dg-final { scan-not-hidden "_ZN1OIiE3fooEv" } } */ |
| 6 |
/* { dg-final { scan-hidden "_ZN1S3fooEv" } } */ |
| 7 |
|
| 8 |
template <class T> |
| 9 |
struct O { |
| 10 |
static inline void foo() { } |
| 11 |
}; |
| 12 |
|
| 13 |
template void O<int>::foo(); |
| 14 |
|
| 15 |
template <class T> |
| 16 |
struct I { |
| 17 |
static inline void foo() { } |
| 18 |
}; |
| 19 |
|
| 20 |
extern template void I<int>::foo(); |
| 21 |
|
| 22 |
struct S { |
| 23 |
static inline void foo() { } |
| 24 |
}; |
| 25 |
|
| 26 |
void bar() { |
| 27 |
I<int>::foo(); |
| 28 |
O<int>::foo(); |
| 29 |
S::foo(); |
| 30 |
} |