| 1 |
// RUN: %clang_cc1 -std=c++17 -emit-llvm -triple x86_64-linux-gnu -o - %s | FileCheck %s |
| 2 |
|
| 3 |
void doSomething(); |
| 4 |
|
| 5 |
struct A { |
| 6 |
A() {}; |
| 7 |
~A() noexcept { |
| 8 |
doSomething(); |
| 9 |
} |
| 10 |
|
| 11 |
A & operator=(A a) & noexcept { |
| 12 |
return *this; |
| 13 |
} |
| 14 |
}; |
| 15 |
|
| 16 |
template<typename T> |
| 17 |
struct B { |
| 18 |
void test() {a = {};} |
| 19 |
// CHECK: define linkonce_odr void @_ZN1BIiE4testEv |
| 20 |
// CHECK: call void @_ZN1AC1Ev(ptr noundef nonnull align 1 dereferenceable(1) |
| 21 |
// CHECK: [[CALL:%.*]] = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNR1AaSES_ |
| 22 |
// CHECK: call void @_ZN1AD2Ev(ptr noundef nonnull align 1 dereferenceable(1) |
| 23 |
|
| 24 |
A a; |
| 25 |
}; |
| 26 |
|
| 27 |
void client(B<int> &f) {f.test();} |