[-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
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user