"target exception specification is not superset of source">;
def err_deep_exception_specs_differ : Error<
"exception specifications of %select{return|argument}0 types differ">;
-def ext_missing_exception_specification : ExtWarn<
- "%0 is missing exception specification '%1'">,
- InGroup<DiagGroup<"missing-exception-spec">>;
def err_missing_exception_specification : Error<
"%0 is missing exception specification '%1'">;
+def ext_missing_exception_specification : ExtWarn<
+ err_missing_exception_specification.Text>,
+ InGroup<DiagGroup<"missing-exception-spec">>;
+def ext_ms_missing_exception_specification : ExtWarn<
+ err_missing_exception_specification.Text>,
+ InGroup<MicrosoftExceptionSpec>;
def err_noexcept_needs_constant_expression : Error<
"argument to noexcept specifier must be a constant expression">;
def err_exception_spec_not_parsed : Error<
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 {