"parentheses were disambiguated as a function declarator")
DIAG(err_expected_member_or_base_name, ERROR,
"expected class member or base class name")
+DIAG(ext_ellipsis_exception_spec, EXTENSION,
+ "exception specification of '...' is a Microsoft extension")
// Language specific pragmas
/// 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");
}
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();