diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-08-30 15:04:51 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-08-30 15:04:51 +0000 |
| commit | f62c5294c1213742e05ed3471a3d43991d825eb7 (patch) | |
| tree | 7fbd13cd8c8662759ed43173da25465d8177672b /clang/lib/Sema/SemaExceptionSpec.cpp | |
| parent | 759ef23bb86ecd18cff8d9732ec54b9cb6f608a9 (diff) | |
| download | bcm5719-llvm-f62c5294c1213742e05ed3471a3d43991d825eb7.tar.gz bcm5719-llvm-f62c5294c1213742e05ed3471a3d43991d825eb7.zip | |
Emulate (some of) Microsoft's looser semantic checking of exception
specifications, from Martin Vejnar!
llvm-svn: 112482
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 101d7417249..c902e778709 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -261,6 +261,14 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID, bool OldAny = !Old->hasExceptionSpec() || Old->hasAnyExceptionSpec(); bool NewAny = !New->hasExceptionSpec() || New->hasAnyExceptionSpec(); + if (getLangOptions().Microsoft) { + // Treat throw(whatever) as throw(...) to be compatible with MS headers. + if (New->hasExceptionSpec() && New->getNumExceptions() > 0) + NewAny = true; + if (Old->hasExceptionSpec() && Old->getNumExceptions() > 0) + OldAny = true; + } + if (OldAny && NewAny) return false; if (OldAny || NewAny) { |

