diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-06-10 18:24:41 +0000 | 
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-10 18:24:41 +0000 | 
| commit | b2b0da4ad08da9a48940c4f5398c5603d78282b7 (patch) | |
| tree | cca61afa4ed5245da2ec1f23399c194d0cf85270 /clang/lib/Sema | |
| parent | d558bdadd25a766cd31109a611396e53546e142b (diff) | |
| download | bcm5719-llvm-b2b0da4ad08da9a48940c4f5398c5603d78282b7.tar.gz bcm5719-llvm-b2b0da4ad08da9a48940c4f5398c5603d78282b7.zip  | |
[-fms-extensions] Permit incomplete types in dynamic exception specifications
Microsoft headers, comdef.h and comutil.h, assume that this is an OK
thing to do.  Downgrade the hard error to a warning if we are in
-fms-extensions mode.
This fixes PR28080.
llvm-svn: 272412
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index f12bf2415db..f2ae6bfe2ff 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -110,10 +110,13 @@ 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; +  if (getLangOpts().MicrosoftExt) +    DiagID = diag::ext_incomplete_in_exception_spec;    if (!(PointeeT->isRecordType() &&          PointeeT->getAs<RecordType>()->isBeingDefined()) && -      RequireCompleteType(Range.getBegin(), PointeeT, -                          diag::err_incomplete_in_exception_spec, Kind, Range)) +      RequireCompleteType(Range.getBegin(), PointeeT, DiagID, Kind, Range))      return true;    return false;  | 

