[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / deprecated-copy-with-user-provided-dtor.cpp
blobf46e1f09618029642182e3324f20f74939acf83f
1 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify
2 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility
3 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify
4 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify -fms-compatibility
6 struct A {
7 ~A(); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided destructor}}
8 };
10 void test() {
11 A a1;
12 A a2(a1); // expected-note {{implicit copy constructor for 'A' first required here}}