aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-01 18:00:20 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-01 18:00:20 +0000
commita4745616ebe36ba7699f18618382e764aa8183a1 (patch)
tree8435d75235d32f7baa3052d95f4176cc495a514c /lib/Parse/ParseDeclCXX.cpp
parentac72d40340ce3eb6ffa932ede41631d666084fec (diff)
Parse the exception-specification throw(...), a Microsoft extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 268de00bc3..78539abaad 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -763,12 +763,13 @@ Parser::MemInitResult Parser::ParseMemInitializer(DeclTy *ConstructorDecl) {
/// ParseExceptionSpecification - Parse a C++ exception-specification
/// (C++ [except.spec]).
///
-/// exception-specification:
-/// 'throw' '(' type-id-list [opt] ')'
+/// exception-specification:
+/// 'throw' '(' type-id-list [opt] ')'
+/// [MS] 'throw' '(' '...' ')'
///
-/// type-id-list:
-/// type-id
-/// type-id-list ',' type-id
+/// type-id-list:
+/// type-id
+/// type-id-list ',' type-id
///
bool Parser::ParseExceptionSpecification() {
assert(Tok.is(tok::kw_throw) && "expected throw");
@@ -780,6 +781,16 @@ bool Parser::ParseExceptionSpecification() {
}
SourceLocation LParenLoc = ConsumeParen();
+ // Parse throw(...), a Microsoft extension that means "this function
+ // can throw anything".
+ if (Tok.is(tok::ellipsis)) {
+ SourceLocation EllipsisLoc = ConsumeToken();
+ if (!getLang().Microsoft)
+ Diag(EllipsisLoc, diag::ext_ellipsis_exception_spec);
+ SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ return false;
+ }
+
// Parse the sequence of type-ids.
while (Tok.isNot(tok::r_paren)) {
ParseTypeName();