Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions clang/lib/Parse/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,13 @@ void Parser::ConsumeExtraSemi(ExtraSemiKind Kind, DeclSpec::TST TST) {
<< FixItHint::CreateRemoval(SourceRange(StartLoc, EndLoc));
}

bool Parser::expectIdentifier() {
if (Tok.is(tok::identifier))
return false;
if (const auto *II = Tok.getIdentifierInfo()) {
if (II->isCPlusPlusKeyword(getLangOpts())) {
bool Parser::expectIdentifier()
{
if (Tok.is(tok::identifier)) return false;
if (const auto* II = Tok.getIdentifierInfo())
{
if (II->isCPlusPlusKeyword(getLangOpts()))
{
Diag(Tok, diag::err_expected_token_instead_of_objcxx_keyword)
<< tok::identifier << Tok.getIdentifierInfo();
// Objective-C++: Recover by treating this keyword as a valid identifier.
Expand All @@ -251,6 +253,7 @@ bool Parser::expectIdentifier() {
return true;
}


void Parser::checkCompoundToken(SourceLocation FirstTokLoc,
tok::TokenKind FirstTokKind, CompoundToken Op) {
if (FirstTokLoc.isInvalid())
Expand Down