2006-12-05 02:06:35 +08:00
|
|
|
//===--- ParseExprCXX.cpp - C++ Expression Parsing ------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 03:59:25 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-12-05 02:06:35 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Expression parsing implementation for C++.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/Basic/Diagnostic.h"
|
|
|
|
#include "clang/Parse/Parser.h"
|
2008-08-22 23:38:55 +08:00
|
|
|
#include "clang/Parse/DeclSpec.h"
|
2006-12-05 02:06:35 +08:00
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
/// ParseCXXCasts - This handles the various ways to cast expressions to another
|
|
|
|
/// type.
|
|
|
|
///
|
|
|
|
/// postfix-expression: [C++ 5.2p1]
|
|
|
|
/// 'dynamic_cast' '<' type-name '>' '(' expression ')'
|
|
|
|
/// 'static_cast' '<' type-name '>' '(' expression ')'
|
|
|
|
/// 'reinterpret_cast' '<' type-name '>' '(' expression ')'
|
|
|
|
/// 'const_cast' '<' type-name '>' '(' expression ')'
|
|
|
|
///
|
|
|
|
Parser::ExprResult Parser::ParseCXXCasts() {
|
|
|
|
tok::TokenKind Kind = Tok.getKind();
|
|
|
|
const char *CastName = 0; // For error messages
|
|
|
|
|
|
|
|
switch (Kind) {
|
|
|
|
default: assert(0 && "Unknown C++ cast!"); abort();
|
|
|
|
case tok::kw_const_cast: CastName = "const_cast"; break;
|
|
|
|
case tok::kw_dynamic_cast: CastName = "dynamic_cast"; break;
|
|
|
|
case tok::kw_reinterpret_cast: CastName = "reinterpret_cast"; break;
|
|
|
|
case tok::kw_static_cast: CastName = "static_cast"; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SourceLocation OpLoc = ConsumeToken();
|
|
|
|
SourceLocation LAngleBracketLoc = Tok.getLocation();
|
|
|
|
|
|
|
|
if (ExpectAndConsume(tok::less, diag::err_expected_less_after, CastName))
|
|
|
|
return ExprResult(true);
|
|
|
|
|
|
|
|
TypeTy *CastTy = ParseTypeName();
|
|
|
|
SourceLocation RAngleBracketLoc = Tok.getLocation();
|
|
|
|
|
|
|
|
if (ExpectAndConsume(tok::greater, diag::err_expected_greater)) {
|
|
|
|
Diag(LAngleBracketLoc, diag::err_matching, "<");
|
|
|
|
return ExprResult(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
SourceLocation LParenLoc = Tok.getLocation(), RParenLoc;
|
|
|
|
|
2007-10-10 01:41:39 +08:00
|
|
|
if (Tok.isNot(tok::l_paren)) {
|
2006-12-05 02:06:35 +08:00
|
|
|
Diag(Tok, diag::err_expected_lparen_after, CastName);
|
|
|
|
return ExprResult(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
ExprResult Result = ParseSimpleParenExpression(RParenLoc);
|
|
|
|
|
|
|
|
if (!Result.isInvalid)
|
2008-10-28 03:41:14 +08:00
|
|
|
Result = Actions.ActOnCXXNamedCast(OpLoc, Kind,
|
|
|
|
LAngleBracketLoc, CastTy, RAngleBracketLoc,
|
|
|
|
LParenLoc, Result.Val, RParenLoc);
|
2006-12-05 02:06:35 +08:00
|
|
|
|
|
|
|
return Result;
|
|
|
|
}
|
2007-02-13 09:51:42 +08:00
|
|
|
|
|
|
|
/// ParseCXXBoolLiteral - This handles the C++ Boolean literals.
|
|
|
|
///
|
|
|
|
/// boolean-literal: [C++ 2.13.5]
|
|
|
|
/// 'true'
|
|
|
|
/// 'false'
|
|
|
|
Parser::ExprResult Parser::ParseCXXBoolLiteral() {
|
|
|
|
tok::TokenKind Kind = Tok.getKind();
|
2007-09-16 22:56:35 +08:00
|
|
|
return Actions.ActOnCXXBoolLiteral(ConsumeToken(), Kind);
|
2007-02-13 09:51:42 +08:00
|
|
|
}
|
2008-02-26 08:51:44 +08:00
|
|
|
|
|
|
|
/// ParseThrowExpression - This handles the C++ throw expression.
|
|
|
|
///
|
|
|
|
/// throw-expression: [C++ 15]
|
|
|
|
/// 'throw' assignment-expression[opt]
|
|
|
|
Parser::ExprResult Parser::ParseThrowExpression() {
|
|
|
|
assert(Tok.is(tok::kw_throw) && "Not throw!");
|
|
|
|
SourceLocation ThrowLoc = ConsumeToken(); // Eat the throw token.
|
2008-04-06 14:03:03 +08:00
|
|
|
|
2008-04-06 14:02:23 +08:00
|
|
|
// If the current token isn't the start of an assignment-expression,
|
|
|
|
// then the expression is not present. This handles things like:
|
|
|
|
// "C ? throw : (void)42", which is crazy but legal.
|
|
|
|
switch (Tok.getKind()) { // FIXME: move this predicate somewhere common.
|
|
|
|
case tok::semi:
|
|
|
|
case tok::r_paren:
|
|
|
|
case tok::r_square:
|
|
|
|
case tok::r_brace:
|
|
|
|
case tok::colon:
|
|
|
|
case tok::comma:
|
2008-02-26 08:51:44 +08:00
|
|
|
return Actions.ActOnCXXThrow(ThrowLoc);
|
|
|
|
|
2008-04-06 14:02:23 +08:00
|
|
|
default:
|
2008-04-06 14:03:03 +08:00
|
|
|
ExprResult Expr = ParseAssignmentExpression();
|
2008-04-06 14:02:23 +08:00
|
|
|
if (Expr.isInvalid) return Expr;
|
|
|
|
return Actions.ActOnCXXThrow(ThrowLoc, Expr.Val);
|
|
|
|
}
|
2008-02-26 08:51:44 +08:00
|
|
|
}
|
2008-06-25 06:12:16 +08:00
|
|
|
|
|
|
|
/// ParseCXXThis - This handles the C++ 'this' pointer.
|
|
|
|
///
|
|
|
|
/// C++ 9.3.2: In the body of a non-static member function, the keyword this is
|
|
|
|
/// a non-lvalue expression whose value is the address of the object for which
|
|
|
|
/// the function is called.
|
|
|
|
Parser::ExprResult Parser::ParseCXXThis() {
|
|
|
|
assert(Tok.is(tok::kw_this) && "Not 'this'!");
|
|
|
|
SourceLocation ThisLoc = ConsumeToken();
|
2008-08-17 03:34:46 +08:00
|
|
|
return Actions.ActOnCXXThis(ThisLoc);
|
2008-06-25 06:12:16 +08:00
|
|
|
}
|
2008-08-22 23:38:55 +08:00
|
|
|
|
|
|
|
/// ParseCXXTypeConstructExpression - Parse construction of a specified type.
|
|
|
|
/// Can be interpreted either as function-style casting ("int(x)")
|
|
|
|
/// or class type construction ("ClassType(x,y,z)")
|
|
|
|
/// or creation of a value-initialized type ("int()").
|
|
|
|
///
|
|
|
|
/// postfix-expression: [C++ 5.2p1]
|
|
|
|
/// simple-type-specifier '(' expression-list[opt] ')' [C++ 5.2.3]
|
|
|
|
/// typename-specifier '(' expression-list[opt] ')' [TODO]
|
|
|
|
///
|
|
|
|
Parser::ExprResult Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
|
|
|
|
Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
|
|
|
|
TypeTy *TypeRep = Actions.ActOnTypeName(CurScope, DeclaratorInfo).Val;
|
|
|
|
|
|
|
|
assert(Tok.is(tok::l_paren) && "Expected '('!");
|
|
|
|
SourceLocation LParenLoc = ConsumeParen();
|
|
|
|
|
|
|
|
ExprListTy Exprs;
|
|
|
|
CommaLocsTy CommaLocs;
|
|
|
|
|
|
|
|
if (Tok.isNot(tok::r_paren)) {
|
|
|
|
if (ParseExpressionList(Exprs, CommaLocs)) {
|
|
|
|
SkipUntil(tok::r_paren);
|
|
|
|
return ExprResult(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Match the ')'.
|
|
|
|
SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
|
|
|
|
|
|
|
|
assert((Exprs.size() == 0 || Exprs.size()-1 == CommaLocs.size())&&
|
|
|
|
"Unexpected number of commas!");
|
|
|
|
return Actions.ActOnCXXTypeConstructExpr(DS.getSourceRange(), TypeRep,
|
|
|
|
LParenLoc,
|
|
|
|
&Exprs[0], Exprs.size(),
|
|
|
|
&CommaLocs[0], RParenLoc);
|
|
|
|
}
|
|
|
|
|
2008-09-10 04:38:47 +08:00
|
|
|
/// ParseCXXCondition - if/switch/while/for condition expression.
|
|
|
|
///
|
|
|
|
/// condition:
|
|
|
|
/// expression
|
|
|
|
/// type-specifier-seq declarator '=' assignment-expression
|
|
|
|
/// [GNU] type-specifier-seq declarator simple-asm-expr[opt] attributes[opt]
|
|
|
|
/// '=' assignment-expression
|
|
|
|
///
|
|
|
|
Parser::ExprResult Parser::ParseCXXCondition() {
|
2008-10-05 23:03:47 +08:00
|
|
|
if (!isCXXConditionDeclaration())
|
2008-09-10 04:38:47 +08:00
|
|
|
return ParseExpression(); // expression
|
|
|
|
|
|
|
|
SourceLocation StartLoc = Tok.getLocation();
|
|
|
|
|
|
|
|
// type-specifier-seq
|
|
|
|
DeclSpec DS;
|
|
|
|
ParseSpecifierQualifierList(DS);
|
|
|
|
|
|
|
|
// declarator
|
|
|
|
Declarator DeclaratorInfo(DS, Declarator::ConditionContext);
|
|
|
|
ParseDeclarator(DeclaratorInfo);
|
|
|
|
|
|
|
|
// simple-asm-expr[opt]
|
|
|
|
if (Tok.is(tok::kw_asm)) {
|
|
|
|
ExprResult AsmLabel = ParseSimpleAsm();
|
|
|
|
if (AsmLabel.isInvalid) {
|
|
|
|
SkipUntil(tok::semi);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
DeclaratorInfo.setAsmLabel(AsmLabel.Val);
|
|
|
|
}
|
|
|
|
|
|
|
|
// If attributes are present, parse them.
|
|
|
|
if (Tok.is(tok::kw___attribute))
|
|
|
|
DeclaratorInfo.AddAttributes(ParseAttributes());
|
|
|
|
|
|
|
|
// '=' assignment-expression
|
|
|
|
if (Tok.isNot(tok::equal))
|
|
|
|
return Diag(Tok, diag::err_expected_equal_after_declarator);
|
|
|
|
SourceLocation EqualLoc = ConsumeToken();
|
|
|
|
ExprResult AssignExpr = ParseAssignmentExpression();
|
|
|
|
if (AssignExpr.isInvalid)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return Actions.ActOnCXXConditionDeclarationExpr(CurScope, StartLoc,
|
|
|
|
DeclaratorInfo,
|
|
|
|
EqualLoc, AssignExpr.Val);
|
|
|
|
}
|
|
|
|
|
2008-08-22 23:38:55 +08:00
|
|
|
/// ParseCXXSimpleTypeSpecifier - [C++ 7.1.5.2] Simple type specifiers.
|
|
|
|
/// This should only be called when the current token is known to be part of
|
|
|
|
/// simple-type-specifier.
|
|
|
|
///
|
|
|
|
/// simple-type-specifier:
|
|
|
|
/// '::'[opt] nested-name-specifier[opt] type-name [TODO]
|
|
|
|
/// '::'[opt] nested-name-specifier 'template' simple-template-id [TODO]
|
|
|
|
/// char
|
|
|
|
/// wchar_t
|
|
|
|
/// bool
|
|
|
|
/// short
|
|
|
|
/// int
|
|
|
|
/// long
|
|
|
|
/// signed
|
|
|
|
/// unsigned
|
|
|
|
/// float
|
|
|
|
/// double
|
|
|
|
/// void
|
|
|
|
/// [GNU] typeof-specifier
|
|
|
|
/// [C++0x] auto [TODO]
|
|
|
|
///
|
|
|
|
/// type-name:
|
|
|
|
/// class-name
|
|
|
|
/// enum-name
|
|
|
|
/// typedef-name
|
|
|
|
///
|
|
|
|
void Parser::ParseCXXSimpleTypeSpecifier(DeclSpec &DS) {
|
|
|
|
DS.SetRangeStart(Tok.getLocation());
|
|
|
|
const char *PrevSpec;
|
|
|
|
SourceLocation Loc = Tok.getLocation();
|
|
|
|
|
|
|
|
switch (Tok.getKind()) {
|
|
|
|
default:
|
|
|
|
assert(0 && "Not a simple-type-specifier token!");
|
|
|
|
abort();
|
|
|
|
|
|
|
|
// type-name
|
|
|
|
case tok::identifier: {
|
|
|
|
TypeTy *TypeRep = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope);
|
|
|
|
assert(TypeRep && "Identifier wasn't a type-name!");
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_typedef, Loc, PrevSpec, TypeRep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// builtin types
|
|
|
|
case tok::kw_short:
|
|
|
|
DS.SetTypeSpecWidth(DeclSpec::TSW_short, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_long:
|
|
|
|
DS.SetTypeSpecWidth(DeclSpec::TSW_long, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_signed:
|
|
|
|
DS.SetTypeSpecSign(DeclSpec::TSS_signed, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_unsigned:
|
|
|
|
DS.SetTypeSpecSign(DeclSpec::TSS_unsigned, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_void:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_void, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_char:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_char, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_int:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_int, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_float:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_float, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_double:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_double, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_wchar_t:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_wchar, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
case tok::kw_bool:
|
|
|
|
DS.SetTypeSpecType(DeclSpec::TST_bool, Loc, PrevSpec);
|
|
|
|
break;
|
|
|
|
|
|
|
|
// GNU typeof support.
|
|
|
|
case tok::kw_typeof:
|
|
|
|
ParseTypeofSpecifier(DS);
|
|
|
|
DS.Finish(Diags, PP.getSourceManager(), getLang());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
DS.SetRangeEnd(Tok.getLocation());
|
|
|
|
ConsumeToken();
|
|
|
|
DS.Finish(Diags, PP.getSourceManager(), getLang());
|
|
|
|
}
|
2008-11-07 06:13:31 +08:00
|
|
|
|
2008-11-08 04:08:42 +08:00
|
|
|
/// ParseCXXTypeSpecifierSeq - Parse a C++ type-specifier-seq (C++
|
|
|
|
/// [dcl.name]), which is a non-empty sequence of type-specifiers,
|
|
|
|
/// e.g., "const short int". Note that the DeclSpec is *not* finished
|
|
|
|
/// by parsing the type-specifier-seq, because these sequences are
|
|
|
|
/// typically followed by some form of declarator. Returns true and
|
|
|
|
/// emits diagnostics if this is not a type-specifier-seq, false
|
|
|
|
/// otherwise.
|
|
|
|
///
|
|
|
|
/// type-specifier-seq: [C++ 8.1]
|
|
|
|
/// type-specifier type-specifier-seq[opt]
|
|
|
|
///
|
|
|
|
bool Parser::ParseCXXTypeSpecifierSeq(DeclSpec &DS) {
|
|
|
|
DS.SetRangeStart(Tok.getLocation());
|
|
|
|
const char *PrevSpec = 0;
|
|
|
|
int isInvalid = 0;
|
|
|
|
|
|
|
|
// Parse one or more of the type specifiers.
|
|
|
|
if (!MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) {
|
|
|
|
Diag(Tok.getLocation(), diag::err_operator_missing_type_specifier);
|
|
|
|
return true;
|
|
|
|
}
|
2008-11-08 12:28:37 +08:00
|
|
|
while (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) ;
|
2008-11-08 04:08:42 +08:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-11-07 06:13:31 +08:00
|
|
|
/// MaybeParseOperatorFunctionId - Attempts to parse a C++ overloaded
|
|
|
|
/// operator name (C++ [over.oper]). If successful, returns the
|
|
|
|
/// predefined identifier that corresponds to that overloaded
|
|
|
|
/// operator. Otherwise, returns NULL and does not consume any tokens.
|
|
|
|
///
|
|
|
|
/// operator-function-id: [C++ 13.5]
|
|
|
|
/// 'operator' operator
|
|
|
|
///
|
|
|
|
/// operator: one of
|
|
|
|
/// new delete new[] delete[]
|
|
|
|
/// + - * / % ^ & | ~
|
|
|
|
/// ! = < > += -= *= /= %=
|
|
|
|
/// ^= &= |= << >> >>= <<= == !=
|
|
|
|
/// <= >= && || ++ -- , ->* ->
|
|
|
|
/// () []
|
|
|
|
IdentifierInfo *Parser::MaybeParseOperatorFunctionId() {
|
2008-11-07 23:54:02 +08:00
|
|
|
assert(Tok.is(tok::kw_operator) && "Expected 'operator' keyword");
|
2008-11-07 06:13:31 +08:00
|
|
|
|
|
|
|
OverloadedOperatorKind Op = OO_None;
|
|
|
|
switch (NextToken().getKind()) {
|
|
|
|
case tok::kw_new:
|
|
|
|
ConsumeToken(); // 'operator'
|
|
|
|
ConsumeToken(); // 'new'
|
|
|
|
if (Tok.is(tok::l_square)) {
|
|
|
|
ConsumeBracket(); // '['
|
|
|
|
ExpectAndConsume(tok::r_square, diag::err_expected_rsquare); // ']'
|
|
|
|
Op = OO_Array_New;
|
|
|
|
} else {
|
|
|
|
Op = OO_New;
|
|
|
|
}
|
|
|
|
return &PP.getIdentifierTable().getOverloadedOperator(Op);
|
|
|
|
|
|
|
|
case tok::kw_delete:
|
|
|
|
ConsumeToken(); // 'operator'
|
|
|
|
ConsumeToken(); // 'delete'
|
|
|
|
if (Tok.is(tok::l_square)) {
|
|
|
|
ConsumeBracket(); // '['
|
|
|
|
ExpectAndConsume(tok::r_square, diag::err_expected_rsquare); // ']'
|
|
|
|
Op = OO_Array_Delete;
|
|
|
|
} else {
|
|
|
|
Op = OO_Delete;
|
|
|
|
}
|
|
|
|
return &PP.getIdentifierTable().getOverloadedOperator(Op);
|
|
|
|
|
|
|
|
#define OVERLOADED_OPERATOR(Name,Spelling,Token) \
|
|
|
|
case tok::Token: Op = OO_##Name; break;
|
|
|
|
#define OVERLOADED_OPERATOR_MULTI(Name,Spelling)
|
|
|
|
#include "clang/Basic/OperatorKinds.def"
|
|
|
|
|
|
|
|
case tok::l_paren:
|
|
|
|
ConsumeToken(); // 'operator'
|
|
|
|
ConsumeParen(); // '('
|
|
|
|
ExpectAndConsume(tok::r_paren, diag::err_expected_rparen); // ')'
|
|
|
|
return &PP.getIdentifierTable().getOverloadedOperator(OO_Call);
|
|
|
|
|
|
|
|
case tok::l_square:
|
|
|
|
ConsumeToken(); // 'operator'
|
|
|
|
ConsumeBracket(); // '['
|
|
|
|
ExpectAndConsume(tok::r_square, diag::err_expected_rsquare); // ']'
|
|
|
|
return &PP.getIdentifierTable().getOverloadedOperator(OO_Subscript);
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Op == OO_None)
|
|
|
|
return 0;
|
|
|
|
else {
|
2008-11-07 23:54:02 +08:00
|
|
|
ConsumeToken(); // 'operator'
|
2008-11-07 06:13:31 +08:00
|
|
|
ConsumeAnyToken(); // the operator itself
|
|
|
|
return &PP.getIdentifierTable().getOverloadedOperator(Op);
|
|
|
|
}
|
|
|
|
}
|
2008-11-08 04:08:42 +08:00
|
|
|
|
|
|
|
/// ParseConversionFunctionId - Parse a C++ conversion-function-id,
|
|
|
|
/// which expresses the name of a user-defined conversion operator
|
|
|
|
/// (C++ [class.conv.fct]p1). Returns the type that this operator is
|
|
|
|
/// specifying a conversion for, or NULL if there was an error.
|
|
|
|
///
|
|
|
|
/// conversion-function-id: [C++ 12.3.2]
|
|
|
|
/// operator conversion-type-id
|
|
|
|
///
|
|
|
|
/// conversion-type-id:
|
|
|
|
/// type-specifier-seq conversion-declarator[opt]
|
|
|
|
///
|
|
|
|
/// conversion-declarator:
|
|
|
|
/// ptr-operator conversion-declarator[opt]
|
|
|
|
Parser::TypeTy *Parser::ParseConversionFunctionId() {
|
|
|
|
assert(Tok.is(tok::kw_operator) && "Expected 'operator' keyword");
|
|
|
|
ConsumeToken(); // 'operator'
|
|
|
|
|
|
|
|
// Parse the type-specifier-seq.
|
|
|
|
DeclSpec DS;
|
|
|
|
if (ParseCXXTypeSpecifierSeq(DS))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Parse the conversion-declarator, which is merely a sequence of
|
|
|
|
// ptr-operators.
|
|
|
|
Declarator D(DS, Declarator::TypeNameContext);
|
|
|
|
ParseDeclaratorInternal(D, /*PtrOperator=*/true);
|
|
|
|
|
|
|
|
// Finish up the type.
|
|
|
|
Action::TypeResult Result = Actions.ActOnTypeName(CurScope, D);
|
|
|
|
if (Result.isInvalid)
|
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
return Result.Val;
|
|
|
|
}
|