annotate clang/test/CodeGenCXX/union-dtor.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++11 %s -S -o - -emit-llvm | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // PR10304: destructors should not call destructors for variant members.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 template<bool b = false>
anatofuz
parents:
diff changeset
6 struct Foo {
anatofuz
parents:
diff changeset
7 Foo() { static_assert(b, "Foo::Foo used"); }
anatofuz
parents:
diff changeset
8 ~Foo() { static_assert(b, "Foo::~Foo used"); }
anatofuz
parents:
diff changeset
9 };
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 struct Bar {
anatofuz
parents:
diff changeset
12 Bar();
anatofuz
parents:
diff changeset
13 ~Bar();
anatofuz
parents:
diff changeset
14 };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 union FooBar {
anatofuz
parents:
diff changeset
17 FooBar() {}
anatofuz
parents:
diff changeset
18 ~FooBar() {}
anatofuz
parents:
diff changeset
19 Foo<> foo;
anatofuz
parents:
diff changeset
20 Bar bar;
anatofuz
parents:
diff changeset
21 };
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 struct Variant {
anatofuz
parents:
diff changeset
24 Variant() {}
anatofuz
parents:
diff changeset
25 ~Variant() {}
anatofuz
parents:
diff changeset
26 union {
anatofuz
parents:
diff changeset
27 Foo<> foo;
anatofuz
parents:
diff changeset
28 Bar bar;
anatofuz
parents:
diff changeset
29 };
anatofuz
parents:
diff changeset
30 };
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 FooBar foobar;
anatofuz
parents:
diff changeset
33 Variant variant;
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 // The ctor and dtor of Foo<> and Bar should not be mentioned in the resulting
anatofuz
parents:
diff changeset
36 // code.
anatofuz
parents:
diff changeset
37 //
anatofuz
parents:
diff changeset
38 // CHECK-NOT: 3FooILb1EEC1
anatofuz
parents:
diff changeset
39 // CHECK-NOT: 3BarC1
anatofuz
parents:
diff changeset
40 //
anatofuz
parents:
diff changeset
41 // CHECK-NOT: 3FooILb1EED1
anatofuz
parents:
diff changeset
42 // CHECK-NOT: 3BarD1