llvm-for-llvmta/tools/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p20.cpp

14 lines
217 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
// expected-no-diagnostics
template<typename T>
void destroy(T* ptr) {
ptr->~T();
(*ptr).~T();
}
void destructor() {
auto lambda = []{};
destroy(&lambda);
}