ningvin updated this revision to Diff 459277. ningvin added a comment. I added the respective RUN lines to the different test cases, did not seem to break anything on my end.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133354/new/ https://reviews.llvm.org/D133354 Files: clang/lib/Sema/SemaDeclCXX.cpp clang/test/SemaCXX/deprecated-copy-with-dtor.cpp clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp clang/test/SemaCXX/deprecated-copy.cpp clang/test/SemaCXX/deprecated.cpp Index: clang/test/SemaCXX/deprecated.cpp =================================================================== --- clang/test/SemaCXX/deprecated.cpp +++ clang/test/SemaCXX/deprecated.cpp @@ -1,10 +1,16 @@ // RUN: %clang_cc1 -std=c++98 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++98 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++11 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++17 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++17 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++2a %s -Wno-parentheses -Wdeprecated -verify=expected,cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++2a %s -Wno-parentheses -Wdeprecated -verify=expected,cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS +// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS -fms-compatibility #include "Inputs/register.h" Index: clang/test/SemaCXX/deprecated-copy.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy.cpp +++ clang/test/SemaCXX/deprecated-copy.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy -verify -fms-compatibility struct A { A& operator=(const A&) = default; // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-declared copy assignment operator}} Index: clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp +++ clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify -fms-compatibility struct A { ~A(); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided destructor}} Index: clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp +++ clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-copy -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-copy -verify -fms-compatibility struct A { A &operator=(const A &); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided copy assignment operator}} Index: clang/test/SemaCXX/deprecated-copy-with-dtor.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-dtor.cpp +++ clang/test/SemaCXX/deprecated-copy-with-dtor.cpp @@ -1,6 +1,9 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-dtor -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-dtor -verify -fms-compatibility class A { public: Index: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -14431,13 +14431,10 @@ CXXRecordDecl *RD = CopyOp->getParent(); CXXMethodDecl *UserDeclaredOperation = nullptr; - // In Microsoft mode, assignment operations don't affect constructors and - // vice versa. if (RD->hasUserDeclaredDestructor()) { UserDeclaredOperation = RD->getDestructor(); } else if (!isa<CXXConstructorDecl>(CopyOp) && - RD->hasUserDeclaredCopyConstructor() && - !S.getLangOpts().MSVCCompat) { + RD->hasUserDeclaredCopyConstructor()) { // Find any user-declared copy constructor. for (auto *I : RD->ctors()) { if (I->isCopyConstructor()) { @@ -14447,8 +14444,7 @@ } assert(UserDeclaredOperation); } else if (isa<CXXConstructorDecl>(CopyOp) && - RD->hasUserDeclaredCopyAssignment() && - !S.getLangOpts().MSVCCompat) { + RD->hasUserDeclaredCopyAssignment()) { // Find any user-declared move assignment operator. for (auto *I : RD->methods()) { if (I->isCopyAssignmentOperator()) {
Index: clang/test/SemaCXX/deprecated.cpp =================================================================== --- clang/test/SemaCXX/deprecated.cpp +++ clang/test/SemaCXX/deprecated.cpp @@ -1,10 +1,16 @@ // RUN: %clang_cc1 -std=c++98 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++98 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++11 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++17 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++17 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++2a %s -Wno-parentheses -Wdeprecated -verify=expected,cxx20 -triple x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++2a %s -Wno-parentheses -Wdeprecated -verify=expected,cxx20 -triple x86_64-linux-gnu -fms-compatibility // RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS +// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS -fms-compatibility #include "Inputs/register.h" Index: clang/test/SemaCXX/deprecated-copy.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy.cpp +++ clang/test/SemaCXX/deprecated-copy.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy -verify -fms-compatibility struct A { A& operator=(const A&) = default; // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-declared copy assignment operator}} Index: clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp +++ clang/test/SemaCXX/deprecated-copy-with-user-provided-dtor.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-dtor -verify -fms-compatibility struct A { ~A(); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided destructor}} Index: clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp +++ clang/test/SemaCXX/deprecated-copy-with-user-provided-copy.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-copy -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-user-provided-copy -verify -fms-compatibility struct A { A &operator=(const A &); // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-provided copy assignment operator}} Index: clang/test/SemaCXX/deprecated-copy-with-dtor.cpp =================================================================== --- clang/test/SemaCXX/deprecated-copy-with-dtor.cpp +++ clang/test/SemaCXX/deprecated-copy-with-dtor.cpp @@ -1,6 +1,9 @@ // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-dtor -verify -fms-compatibility // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-dtor -verify +// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-with-dtor -verify -fms-compatibility class A { public: Index: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -14431,13 +14431,10 @@ CXXRecordDecl *RD = CopyOp->getParent(); CXXMethodDecl *UserDeclaredOperation = nullptr; - // In Microsoft mode, assignment operations don't affect constructors and - // vice versa. if (RD->hasUserDeclaredDestructor()) { UserDeclaredOperation = RD->getDestructor(); } else if (!isa<CXXConstructorDecl>(CopyOp) && - RD->hasUserDeclaredCopyConstructor() && - !S.getLangOpts().MSVCCompat) { + RD->hasUserDeclaredCopyConstructor()) { // Find any user-declared copy constructor. for (auto *I : RD->ctors()) { if (I->isCopyConstructor()) { @@ -14447,8 +14444,7 @@ } assert(UserDeclaredOperation); } else if (isa<CXXConstructorDecl>(CopyOp) && - RD->hasUserDeclaredCopyAssignment() && - !S.getLangOpts().MSVCCompat) { + RD->hasUserDeclaredCopyAssignment()) { // Find any user-declared move assignment operator. for (auto *I : RD->methods()) { if (I->isCopyAssignmentOperator()) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits