summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaExceptionSpec.cpp7
-rw-r--r--clang/test/SemaCXX/ms-exception-spec.cpp7
2 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp
index f2ae6bfe2ff..b7bed6de2d7 100644
--- a/clang/lib/Sema/SemaExceptionSpec.cpp
+++ b/clang/lib/Sema/SemaExceptionSpec.cpp
@@ -112,12 +112,15 @@ bool Sema::CheckSpecifiedExceptionType(QualType &T, SourceRange Range) {
// 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)
+ 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, DiagID, Kind, Range))
- return true;
+ return ReturnValueOnError;
return false;
}
diff --git a/clang/test/SemaCXX/ms-exception-spec.cpp b/clang/test/SemaCXX/ms-exception-spec.cpp
index 81e04dd54df..07633791b9f 100644
--- a/clang/test/SemaCXX/ms-exception-spec.cpp
+++ b/clang/test/SemaCXX/ms-exception-spec.cpp
@@ -1,8 +1,9 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions
+// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions -fexceptions -fcxx-exceptions
void f() throw(...) { }
namespace PR28080 {
-struct S; // expected-note {{forward declaration}}
-void fn() throw(S); // expected-warning {{incomplete type}}
+struct S; // expected-note {{forward declaration}}
+void fn() throw(S); // expected-warning {{incomplete type}} expected-note{{previous declaration}}
+void fn() throw(); // expected-warning {{does not match previous declaration}}
}
OpenPOWER on IntegriCloud