28 lines · cpp
1// RUN: %clang_cc1 -std=c++17 -emit-llvm -triple x86_64-linux-gnu -o - %s | FileCheck %s2 3void doSomething();4 5struct A {6 A() {};7 ~A() noexcept {8 doSomething();9 }10 11 A & operator=(A a) & noexcept {12 return *this;13 }14};15 16template<typename T>17struct B {18 void test() {a = {};}19 // CHECK: define linkonce_odr void @_ZN1BIiE4testEv20 // 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 27void client(B<int> &f) {f.test();}28