diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-10-20 20:49:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-20 20:49:21 +0000 |
commit | 06ce8a4c7009dcbd85db26dd12e67a205d304189 (patch) | |
tree | 90201f61c8d7f19eabcab098aac4242282da5dc3 /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | bb178817314419e99b387b22fd129a9b7fa0727d (diff) | |
download | bcm5719-llvm-06ce8a4c7009dcbd85db26dd12e67a205d304189.tar.gz bcm5719-llvm-06ce8a4c7009dcbd85db26dd12e67a205d304189.zip |
[-fms-extensions] Allow missing exception specifications in redeclarations as an extension
Microsoft's ATL headers make use of this MSVC extension, add support for
it and issue a diagnostic under -Wmicrosoft-exception-spec.
This fixes PR25265.
llvm-svn: 250854
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index a4356f6941b..a18824f1552 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -285,10 +285,14 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { NewProto->getExtProtoInfo().withExceptionSpec(ESI))); } - // Allow missing exception specifications in redeclarations as an extension, - // when declaring a replaceable global allocation function. - if (New->isReplaceableGlobalAllocationFunction() && - ESI.Type != EST_ComputedNoexcept) { + if (getLangOpts().MicrosoftExt && ESI.Type != EST_ComputedNoexcept) { + // Allow missing exception specifications in redeclarations as an extension. + DiagID = diag::ext_ms_missing_exception_specification; + ReturnValueOnError = false; + } else if (New->isReplaceableGlobalAllocationFunction() && + ESI.Type != EST_ComputedNoexcept) { + // Allow missing exception specifications in redeclarations as an extension, + // when declaring a replaceable global allocation function. DiagID = diag::ext_missing_exception_specification; ReturnValueOnError = false; } else { |