Disable exception-spec compatibility checking under -fno-exceptions.

Fixes PR7243.

llvm-svn: 104942
This commit is contained in:
John McCall
2010-05-28 08:37:35 +00:00
parent 2177a9b65a
commit f9c94093f9
2 changed files with 41 additions and 0 deletions

View File

@@ -249,6 +249,10 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
SourceLocation NewLoc,
bool *MissingExceptionSpecification,
bool *MissingEmptyExceptionSpecification) {
// Just completely ignore this under -fno-exceptions.
if (!getLangOptions().Exceptions)
return false;
if (MissingExceptionSpecification)
*MissingExceptionSpecification = false;
@@ -318,6 +322,11 @@ bool Sema::CheckExceptionSpecSubset(
const PartialDiagnostic &DiagID, const PartialDiagnostic & NoteID,
const FunctionProtoType *Superset, SourceLocation SuperLoc,
const FunctionProtoType *Subset, SourceLocation SubLoc) {
// Just auto-succeed under -fno-exceptions.
if (!getLangOptions().Exceptions)
return false;
// FIXME: As usual, we could be more specific in our error messages, but
// that better waits until we've got types with source locations.