Remove a bunch of #if 0'd code made irrelevant by the latest ParseUnqualifiedId changes

llvm-svn: 85938
This commit is contained in:
Douglas Gregor 2009-11-03 20:53:48 +00:00
parent 2c427233d4
commit 7f4d7ea3a9
1 changed files with 0 additions and 106 deletions

View File

@ -982,112 +982,6 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) {
SS, Name, ObjCImpDecl,
Tok.is(tok::l_paren));
#if 0
if (Tok.is(tok::identifier)) {
if (!LHS.isInvalid())
LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc,
OpKind, Tok.getLocation(),
*Tok.getIdentifierInfo(),
ObjCImpDecl, &SS);
ConsumeToken();
} else if (getLang().CPlusPlus && Tok.is(tok::tilde)) {
// We have a C++ pseudo-destructor or a destructor call, e.g., t.~T()
// Consume the tilde.
ConsumeToken();
if (!Tok.is(tok::identifier)) {
Diag(Tok, diag::err_expected_ident);
return ExprError();
}
if (NextToken().is(tok::less)) {
// class-name:
// ~ simple-template-id
TemplateTy Template
= Actions.ActOnDependentTemplateName(SourceLocation(),
*Tok.getIdentifierInfo(),
Tok.getLocation(),
SS,
ObjectType);
if (AnnotateTemplateIdToken(Template, TNK_Type_template, &SS,
SourceLocation(), true))
return ExprError();
assert(Tok.is(tok::annot_typename) &&
"AnnotateTemplateIdToken didn't work?");
if (!LHS.isInvalid())
LHS = Actions.ActOnDestructorReferenceExpr(CurScope, move(LHS),
OpLoc, OpKind,
Tok.getAnnotationRange(),
Tok.getAnnotationValue(),
SS,
NextToken().is(tok::l_paren));
} else {
// class-name:
// ~ identifier
if (!LHS.isInvalid())
LHS = Actions.ActOnDestructorReferenceExpr(CurScope, move(LHS),
OpLoc, OpKind,
Tok.getLocation(),
Tok.getIdentifierInfo(),
SS,
NextToken().is(tok::l_paren));
}
// Consume the identifier or template-id token.
ConsumeToken();
} else if (getLang().CPlusPlus && Tok.is(tok::kw_operator)) {
// We have a reference to a member operator, e.g., t.operator int or
// t.operator+.
SourceLocation OperatorLoc = Tok.getLocation();
if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) {
if (!LHS.isInvalid())
LHS = Actions.ActOnOverloadedOperatorReferenceExpr(CurScope,
move(LHS), OpLoc,
OpKind,
OperatorLoc,
Op, &SS);
// TryParseOperatorFunctionId already consumed our token, so
// don't bother
} else if (TypeTy *ConvType = ParseConversionFunctionId()) {
if (!LHS.isInvalid())
LHS = Actions.ActOnConversionOperatorReferenceExpr(CurScope,
move(LHS), OpLoc,
OpKind,
OperatorLoc,
ConvType, &SS);
} else {
// Don't emit a diagnostic; ParseConversionFunctionId does it for us
return ExprError();
}
} else if (getLang().CPlusPlus && Tok.is(tok::annot_template_id)) {
// We have a reference to a member template along with explicitly-
// specified template arguments, e.g., t.f<int>.
TemplateIdAnnotation *TemplateId
= static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue());
if (!LHS.isInvalid()) {
ASTTemplateArgsPtr TemplateArgsPtr(Actions,
TemplateId->getTemplateArgs(),
TemplateId->getTemplateArgIsType(),
TemplateId->NumArgs);
LHS = Actions.ActOnMemberTemplateIdReferenceExpr(CurScope, move(LHS),
OpLoc, OpKind, SS,
TemplateTy::make(TemplateId->Template),
TemplateId->TemplateNameLoc,
TemplateId->LAngleLoc,
TemplateArgsPtr,
TemplateId->getTemplateArgLocations(),
TemplateId->RAngleLoc);
}
ConsumeToken();
} else {
Diag(Tok, diag::err_expected_ident);
return ExprError();
}
#endif
break;
}
case tok::plusplus: // postfix-expression: postfix-expression '++'