llvm-capstone/clang/test/SemaTemplate/defaulted-destructor-in-temporary.cpp
Argyrios Kyrtzidis f2b24905bf [Sema] Mark the referenced destructor during transformation of a CXXBindTemporaryExpr
Otherwise we will fail to generate the definition of a defaulted destructor,
if the only reference was in a templated temporary.

rdar://89366678

Differential Revision: https://reviews.llvm.org/D120426
2022-03-08 01:00:07 -08:00

26 lines
337 B
C++

// RUN: %clang_cc1 -std=c++11 -triple=x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
// CHECK: define linkonce_odr {{.*}} @_ZN3StrD1Ev
class A {
public:
~A();
};
class Str {
A d;
public:
~Str() = default;
};
class E {
Str s;
template <typename>
void h() {
s = {};
}
void f();
};
void E::f() {
h<int>();
}