diff options
author | Reid Kleckner <rnk@google.com> | 2019-08-27 17:52:03 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-08-27 17:52:03 +0000 |
commit | 39aa8954a4846b317d3da2f0addfce8224b438de (patch) | |
tree | dffd6fbcb459b24f0e941e0d293a422d280ed0ba /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | 0c096da02f556dddc3c67a6dc9cf0bed3914aa00 (diff) | |
download | bcm5719-llvm-39aa8954a4846b317d3da2f0addfce8224b438de.tar.gz bcm5719-llvm-39aa8954a4846b317d3da2f0addfce8224b438de.zip |
Move EH spec mismatches under -fms-compatibility
-fms-extensions is intended to enable conforming language extensions and
-fms-compatibility is intended to language rule relaxations, so a user
could plausibly compile with -fno-ms-compatibility on Windows while
still using dllexport, for example. This exception specification
validation behavior has been handled as a warning since before
-fms-compatibility was added in 2011. I think it's just an oversight
that it hasn't been moved yet.
This will help users find conformance issues in their code such as those
found in _com_ptr_t as described in https://llvm.org/PR42842.
Reviewers: hans
Subscribers: STL_MSFT, cfe-commits
Differential Revision: https://reviews.llvm.org/D66770
llvm-svn: 370087
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 9fd924a8cad..fd843e4a060 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -149,7 +149,7 @@ bool Sema::CheckSpecifiedExceptionType(QualType &T, SourceRange Range) { // In Microsoft mode, downgrade this to a warning. unsigned DiagID = diag::err_incomplete_in_exception_spec; bool ReturnValueOnError = true; - if (getLangOpts().MicrosoftExt) { + if (getLangOpts().MSVCCompat) { DiagID = diag::ext_incomplete_in_exception_spec; ReturnValueOnError = false; } @@ -282,7 +282,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { unsigned DiagID = diag::err_mismatched_exception_spec; bool ReturnValueOnError = true; - if (getLangOpts().MicrosoftExt) { + if (getLangOpts().MSVCCompat) { DiagID = diag::ext_mismatched_exception_spec; ReturnValueOnError = false; } @@ -371,7 +371,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { NewProto->getExtProtoInfo().withExceptionSpec(ESI))); } - if (getLangOpts().MicrosoftExt && ESI.Type != EST_DependentNoexcept) { + if (getLangOpts().MSVCCompat && ESI.Type != EST_DependentNoexcept) { // Allow missing exception specifications in redeclarations as an extension. DiagID = diag::ext_ms_missing_exception_specification; ReturnValueOnError = false; @@ -473,14 +473,14 @@ bool Sema::CheckEquivalentExceptionSpec( return false; unsigned DiagID = diag::err_mismatched_exception_spec; - if (getLangOpts().MicrosoftExt) + if (getLangOpts().MSVCCompat) DiagID = diag::ext_mismatched_exception_spec; bool Result = CheckEquivalentExceptionSpecImpl( *this, PDiag(DiagID), PDiag(diag::note_previous_declaration), Old, OldLoc, New, NewLoc); // In Microsoft mode, mismatching exception specifications just cause a warning. - if (getLangOpts().MicrosoftExt) + if (getLangOpts().MSVCCompat) return false; return Result; } @@ -959,7 +959,7 @@ bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New, } unsigned DiagID = diag::err_override_exception_spec; - if (getLangOpts().MicrosoftExt) + if (getLangOpts().MSVCCompat) DiagID = diag::ext_override_exception_spec; return CheckExceptionSpecSubset(PDiag(DiagID), PDiag(diag::err_deep_exception_specs_differ), |