Have the parser communicate the exception specification to the action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70389 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index c6a373d..f684649 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -1112,7 +1112,9 @@
/// type-id
/// type-id-list ',' type-id
///
-bool Parser::ParseExceptionSpecification(SourceLocation &EndLoc) {
+bool Parser::ParseExceptionSpecification(SourceLocation &EndLoc,
+ std::vector<TypeTy*> &Exceptions,
+ bool &hasAnyExceptionSpec) {
assert(Tok.is(tok::kw_throw) && "expected throw");
SourceLocation ThrowLoc = ConsumeToken();
@@ -1125,6 +1127,7 @@
// Parse throw(...), a Microsoft extension that means "this function
// can throw anything".
if (Tok.is(tok::ellipsis)) {
+ hasAnyExceptionSpec = true;
SourceLocation EllipsisLoc = ConsumeToken();
if (!getLang().Microsoft)
Diag(EllipsisLoc, diag::ext_ellipsis_exception_spec);
@@ -1134,10 +1137,12 @@
// Parse the sequence of type-ids.
while (Tok.isNot(tok::r_paren)) {
- ParseTypeName();
+ TypeResult Res(ParseTypeName());
+ if (!Res.isInvalid())
+ Exceptions.push_back(Res.get());
if (Tok.is(tok::comma))
ConsumeToken();
- else
+ else
break;
}