diff options
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | lib/Sema/SemaExceptionSpec.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index f12bf2415dba..4a21eb308fe5 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/lib/Sema/SemaExceptionSpec.cpp @@ -110,11 +110,17 @@ bool Sema::CheckSpecifiedExceptionType(QualType &T, SourceRange Range) { // A type denoted in an exception-specification shall not denote a // pointer or reference to an incomplete type, other than (cv) void* or a // pointer or reference to a class currently being defined. + // In Microsoft mode, downgrade this to a warning. + unsigned DiagID = diag::err_incomplete_in_exception_spec; + bool ReturnValueOnError = true; + if (getLangOpts().MicrosoftExt) { + DiagID = diag::ext_incomplete_in_exception_spec; + ReturnValueOnError = false; + } if (!(PointeeT->isRecordType() && PointeeT->getAs<RecordType>()->isBeingDefined()) && - RequireCompleteType(Range.getBegin(), PointeeT, - diag::err_incomplete_in_exception_spec, Kind, Range)) - return true; + RequireCompleteType(Range.getBegin(), PointeeT, DiagID, Kind, Range)) + return ReturnValueOnError; return false; } @@ -995,6 +1001,10 @@ CanThrowResult Sema::canThrow(const Expr *E) { return mergeCanThrow(CT, canSubExprsThrow(*this, E)); } + case Expr::CXXInheritedCtorInitExprClass: + return canCalleeThrow(*this, E, + cast<CXXInheritedCtorInitExpr>(E)->getConstructor()); + case Expr::LambdaExprClass: { const LambdaExpr *Lambda = cast<LambdaExpr>(E); CanThrowResult CT = CT_Cannot; @@ -1136,6 +1146,7 @@ CanThrowResult Sema::canThrow(const Expr *E) { case Expr::ObjCIndirectCopyRestoreExprClass: case Expr::ObjCProtocolExprClass: case Expr::ObjCSelectorExprClass: + case Expr::ObjCAvailabilityCheckExprClass: case Expr::OffsetOfExprClass: case Expr::PackExpansionExprClass: case Expr::PseudoObjectExprClass: |