annotate gcc/testsuite/g++.dg/abi/pure-virtual1.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 // Test that we don't need libsupc++ just for __cxa_pure_virtual.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2 // { dg-do link }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 // { dg-require-weak }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 // { dg-additional-options "-fno-rtti -nodefaultlibs -lc" }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 struct A
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 int i;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9 virtual void f() = 0;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 A(): i(0) {}
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 struct B: A
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 virtual void f() {}
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18 int main()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 B b;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 }