• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Parse/

Lines Matching refs:Tok

42   if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) {
77 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) &&
121 Diag(Tok.getLocation(), diag::err_expected_template);
161 } while (Tok.isOneOf(tok::kw_export, tok::kw_template));
164 if (Tok.is(tok::kw_concept))
193 if (Tok.is(tok::kw_static_assert)) {
195 Diag(Tok.getLocation(), diag::err_templated_invalid_declaration)
211 if (Tok.is(tok::kw_using)) {
226 if (Tok.is(tok::semi)) {
257 if (Tok.is(tok::semi))
270 if (Tok.is(tok::kw_requires))
283 Diag(Tok, diag::err_function_definition_not_allowed);
302 Diag(Tok, diag::err_template_defn_explicit_instantiation) << 0;
334 if (Tok.is(tok::comma)) {
335 Diag(Tok, diag::err_multiple_template_declarators)
360 assert(Tok.is(tok::kw_concept) &&
367 Diag(Tok.getLocation(), diag::ext_concept_legacy_bool_keyword) <<
410 Diag(Tok.getLocation(), diag::err_expected) << tok::equal;
422 DeclEnd = Tok.getLocation();
445 Diag(Tok.getLocation(), diag::err_expected_less_after) << "template";
452 if (!Tok.is(tok::greater) && !Tok.is(tok::greatergreater)) {
457 if (Tok.is(tok::greatergreater)) {
463 Tok.setKind(tok::greater);
464 RAngleLoc = Tok.getLocation();
465 Tok.setLocation(Tok.getLocation().getLocWithOffset(1));
467 Diag(Tok.getLocation(), diag::err_expected) << tok::greater;
497 if (Tok.is(tok::comma)) {
499 } else if (Tok.isOneOf(tok::greater, tok::greatergreater)) {
506 Diag(Tok.getLocation(), diag::err_expected_comma_greater);
518 if (Tok.is(tok::kw_class)) {
557 !GetLookAheadToken(Tok.is(tok::annot_cxxscope) ? 2 : 1)
563 if (Tok.isNot(tok::kw_typename) && Tok.isNot(tok::kw_typedef))
624 if (Tok.is(tok::kw_typedef)) {
625 Diag(Tok.getLocation(), diag::err_expected_template_parameter);
627 Diag(Tok.getLocation(), diag::note_meant_to_use_typename)
629 Tok.getLocation(),
630 Tok.getEndLoc()),
633 Tok.setKind(tok::kw_typename);
650 D.SetIdentifier(nullptr, Tok.getLocation());
665 if (Tok.is(tok::kw_template))
677 const Token &T = Tok.is(tok::annot_cxxscope) ? NextToken() : Tok;
697 bool WasScopeAnnotation = Tok.is(tok::annot_cxxscope);
713 if (Tok.is(tok::identifier)) {
715 PossibleConceptName.setIdentifier(Tok.getIdentifierInfo(),
716 Tok.getLocation());
761 assert((Tok.isOneOf(tok::kw_class, tok::kw_typename) ||
773 if (Tok.is(tok::annot_template_id)) {
776 static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue());
785 TypenameKeyword = Tok.is(tok::kw_typename);
799 SourceLocation NameLoc = Tok.getLocation();
801 if (Tok.is(tok::identifier)) {
802 ParamName = Tok.getIdentifierInfo();
804 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
809 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
857 assert(Tok.is(tok::kw_template) && "Expected 'template' keyword");
877 bool Replace = Tok.isOneOf(tok::kw_typename, tok::kw_struct);
878 const Token &Next = Tok.is(tok::kw_struct) ? NextToken() : Tok;
879 if (Tok.is(tok::kw_typename)) {
880 Diag(Tok.getLocation(),
885 ? FixItHint::CreateReplacement(Tok.getLocation(), "class")
889 Diag(Tok.getLocation(), diag::err_class_on_template_template_param)
890 << (Replace ? FixItHint::CreateReplacement(Tok.getLocation(), "class")
891 : FixItHint::CreateInsertion(Tok.getLocation(), "class "));
893 Diag(Tok.getLocation(), diag::err_class_on_template_template_param);
908 SourceLocation NameLoc = Tok.getLocation();
910 if (Tok.is(tok::identifier)) {
911 ParamName = Tok.getIdentifierInfo();
913 } else if (Tok.isOneOf(tok::equal, tok::comma, tok::greater,
918 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier;
941 Diag(Tok.getLocation(),
973 Diag(Tok.getLocation(), diag::err_expected_template_parameter);
1054 switch (Tok.getKind()) {
1063 RAngleLoc = Tok.getLocation();
1084 areTokensAdjacent(Tok, NextToken())) {
1104 SourceLocation TokLoc = Tok.getLocation();
1116 areTokensAdjacent(Tok, Next);
1139 (Tok.is(tok::greatergreater) || Tok.is(tok::greatergreatergreater)))
1141 else if (Tok.is(tok::greaterequal))
1157 bool CachingTokens = PP.IsPreviousCachedToken(Tok);
1159 Token Greater = Tok;
1164 unsigned OldLength = Tok.getLength();
1167 OldLength += Tok.getLength();
1170 Tok.setKind(RemainingToken);
1171 Tok.setLength(OldLength - GreaterLength);
1177 AfterGreaterLoc = PP.SplitToken(AfterGreaterLoc, Tok.getLength());
1178 Tok.setLocation(AfterGreaterLoc);
1187 PP.ReplacePreviousCachedToken({Greater, Tok});
1196 PP.EnterToken(Tok, /*IsReinject=*/true);
1197 Tok = Greater;
1220 assert(Tok.is(tok::less) && "Must have already parsed the template-name");
1229 if (!Tok.isOneOf(tok::greater, tok::greatergreater,
1297 assert((Tok.is(tok::less) || TypeConstraint) &&
1312 if (!TypeConstraint || Tok.is(tok::less)) {
1334 Tok.setKind(tok::annot_typename);
1335 setTypeAnnotation(Tok, Type);
1337 Tok.setLocation(SS.getBeginLoc());
1339 Tok.setLocation(TemplateKWLoc);
1341 Tok.setLocation(TemplateNameLoc);
1345 Tok.setKind(tok::annot_template_id);
1361 Tok.setAnnotationValue(TemplateId);
1363 Tok.setLocation(TemplateKWLoc);
1365 Tok.setLocation(TemplateNameLoc);
1369 Tok.setAnnotationEndLoc(RAngleLoc);
1373 PP.AnnotateCachedTokens(Tok);
1392 assert(Tok.is(tok::annot_template_id) && "Requires template-id tokens");
1394 TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
1411 Tok.setKind(tok::annot_typename);
1412 setTypeAnnotation(Tok, Type);
1414 Tok.setLocation(SS.getBeginLoc());
1419 PP.AnnotateCachedTokens(Tok);
1423 static bool isEndOfTemplateArgument(Token Tok) {
1425 return Tok.isOneOf(tok::comma, tok::greater, tok::greatergreater,
1431 if (!Tok.is(tok::identifier) && !Tok.is(tok::coloncolon) &&
1432 !Tok.is(tok::annot_cxxscope))
1453 if (SS.isSet() && Tok.is(tok::kw_template)) {
1458 if (Tok.is(tok::identifier)) {
1461 Name.setIdentifier(Tok.getIdentifierInfo(), Tok.getLocation());
1470 if (isEndOfTemplateArgument(Tok) &&
1476 } else if (Tok.is(tok::identifier)) {
1480 Name.setIdentifier(Tok.getIdentifierInfo(), Tok.getLocation());
1485 if (isEndOfTemplateArgument(Tok)) {
1550 SourceLocation Loc = Tok.getLocation();
1666 LPT.Toks.push_back(Tok);
1671 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try) &&
1684 if (Tok.is(tok::kw_try)) {
1687 if (Tok.is(tok::colon))
1692 if (Tok.is(tok::l_brace)) {
1708 tok::TokenKind kind = Tok.getKind();
1716 while (Tok.is(tok::kw_catch)) {
1748 assert(Tok.is(tok::less) && "not at a potential angle bracket");
1793 (Tok.hasLeadingSpace() ? AngleBracketTracker::SpaceBeforeLess
1795 AngleBrackets.add(*this, PotentialTemplateName.get(), Tok.getLocation(),
1813 if (OpToken.is(tok::greater) && Tok.is(tok::l_paren) &&