diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-25 23:46:41 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-25 23:46:41 +0000 |
commit | ec7738776ba68576db5d8316af399d1f983245ee (patch) | |
tree | 9597acbccf36814092f996cad8abd2a9c3a42b0f /lib/Parse/ParseExpr.cpp | |
parent | 11401c6611554d9f43e1fbdc38bb39b09321604d (diff) |
Parsing of pseudo-destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 7303f57dde..16d3511dd7 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -933,18 +933,34 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { ParseOptionalCXXScopeSpecifier(SS); } - if (Tok.isNot(tok::identifier)) { + if (Tok.is(tok::identifier)) { + if (!LHS.isInvalid()) + LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc, + OpKind, Tok.getLocation(), + *Tok.getIdentifierInfo(), + ObjCImpDecl, &SS); + } else if (getLang().CPlusPlus && Tok.is(tok::tilde)) { + // We have a C++ pseudo-destructor. + + // Consume the tilde. + ConsumeToken(); + + if (!Tok.is(tok::identifier)) { + Diag(Tok, diag::err_expected_ident); + return ExprError(); + } + + if (!LHS.isInvalid()) + LHS = Actions.ActOnPseudoDtorReferenceExpr(CurScope, move(LHS), + OpLoc, OpKind, + Tok.getLocation(), + Tok.getIdentifierInfo(), + &SS); + } else { Diag(Tok, diag::err_expected_ident); return ExprError(); } - if (!LHS.isInvalid()) { - LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc, - OpKind, Tok.getLocation(), - *Tok.getIdentifierInfo(), - ObjCImpDecl, &SS); - } - if (getLang().CPlusPlus) Actions.ActOnCXXExitMemberScope(CurScope, MemberSS); |