annotate gcc/testsuite/g++.dg/ext/visibility/warn3.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Tests for various visibility mismatch situations.
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 // { dg-require-visibility "" }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // { dg-final { scan-not-hidden "_ZN1A1fEv" } }
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct __attribute ((visibility ("hidden"))) A
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 // This is OK, A::f gets default visibility.
kono
parents:
diff changeset
10 __attribute ((visibility ("default"))) void f ();
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 void A::f() { }
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 // This gets a warning because B objects might rely
kono
parents:
diff changeset
16 // on hidden symbols from A.
kono
parents:
diff changeset
17 struct B // { dg-warning "visibility" }
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 A a;
kono
parents:
diff changeset
20 };
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 // This one has explicit visibility, so it doesn't get a warning.
kono
parents:
diff changeset
23 struct __attribute ((visibility ("default"))) C
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 A a;
kono
parents:
diff changeset
26 };