diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-01 18:00:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-01 18:00:20 +0000 |
commit | 356513d7d005dc811657bf7413b6bfbed9632a1e (patch) | |
tree | 65a2f50345ac35708264e7af8ba1553c54d18946 /clang/lib/Parse/ParseDeclCXX.cpp | |
parent | 08a4e2045da212ae0a2e0425a18528479e484e9a (diff) | |
download | bcm5719-llvm-356513d7d005dc811657bf7413b6bfbed9632a1e.tar.gz bcm5719-llvm-356513d7d005dc811657bf7413b6bfbed9632a1e.zip |
Parse the exception-specification throw(...), a Microsoft extension
llvm-svn: 60359
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 268de00bc36..78539abaadb 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/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(); |