OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [visibility/] [template1.C] - Blame information for rev 301

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/19134
2
// -fvisibility-inlines-hidden doesn't apply to non-inline specializations
3
 
4
// { dg-require-visibility "" }
5
// { dg-options "-fvisibility-inlines-hidden" }
6
// { dg-final { scan-not-hidden "_ZN1AIiE3fooEv" } }
7
// { dg-final { scan-not-hidden "_ZN1AIiE3barEv" } }
8
// { dg-final { scan-hidden "_ZN1AIlE3fooEv" } }
9
// { dg-final { scan-hidden "_ZN1AIlE3barEv" } }
10
// { dg-final { scan-hidden "_ZN1AIcE3barEv" } }
11
 
12
template
13
struct A {
14
  void foo() {};
15
  __attribute ((visibility ("hidden"))) void bar();
16
};
17
 
18
// This has default visibility.
19
template<> void A::foo() {}
20
 
21
// This has hidden visibility because of -fvisibility-inlines-hidden.
22
template<> inline void A::foo() {}
23
// Force the inline out.
24
void f () { A a; a.foo(); }
25
 
26
// This has default visibility.
27
template<> __attribute ((visibility ("default"))) void A::bar() {}
28
 
29
// This inherits hidden visibility from its template.
30
template<> void A::bar() { }
31
 
32
// This also has hidden visibility; #pragma vis doesn't affect class members.
33
#pragma GCC visibility push(default)
34
template<> void A::bar() { }
35
#pragma GCC visibility pop

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.