• Home
  • Raw
  • Download

Lines Matching refs:tok

61   assert(Tok.is(tok::kw_namespace) && "Not a namespace!");  in ParseNamespace()
65 if (Tok.is(tok::code_completion)) { in ParseNamespace()
87 if (Tok.is(tok::identifier)) { in ParseNamespace()
90 while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) { in ParseNamespace()
102 if (Tok.is(tok::kw___attribute)) { in ParseNamespace()
107 if (Tok.is(tok::equal)) { in ParseNamespace()
109 Diag(Tok, diag::err_expected) << tok::identifier; in ParseNamespace()
111 SkipUntil(tok::semi); in ParseNamespace()
123 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseNamespace()
126 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseNamespace()
128 Diag(Tok, diag::err_expected_either) << tok::identifier << tok::l_brace; in ParseNamespace()
136 SkipUntil(tok::r_brace); in ParseNamespace()
149 SkipUntil(tok::r_brace, StopBeforeMatch); in ParseNamespace()
153 if (!rBraceToken.is(tok::r_brace)) { in ParseNamespace()
216 while (!tryParseMisplacedModuleImport() && Tok.isNot(tok::r_brace) && in ParseInnerNamespace()
217 Tok.isNot(tok::eof)) { in ParseInnerNamespace()
258 assert(Tok.is(tok::equal) && "Not equal token"); in ParseNamespaceAlias()
262 if (Tok.is(tok::code_completion)) { in ParseNamespaceAlias()
272 if (SS.isInvalid() || Tok.isNot(tok::identifier)) { in ParseNamespaceAlias()
275 SkipUntil(tok::semi); in ParseNamespaceAlias()
285 if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after_namespace_name)) in ParseNamespaceAlias()
286 SkipUntil(tok::semi); in ParseNamespaceAlias()
309 Tok.is(tok::l_brace) ? Tok.getLocation() : SourceLocation()); in ParseLinkage()
315 if (Tok.isNot(tok::l_brace)) { in ParseLinkage()
332 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseLinkage()
338 case tok::annot_module_begin: in ParseLinkage()
343 case tok::annot_module_end: in ParseLinkage()
350 case tok::annot_module_include: in ParseLinkage()
354 case tok::eof: in ParseLinkage()
357 case tok::r_brace: in ParseLinkage()
385 assert(Tok.is(tok::kw_using) && "Not using token"); in ParseUsingDirectiveOrDeclaration()
391 if (Tok.is(tok::code_completion)) { in ParseUsingDirectiveOrDeclaration()
398 if (Tok.is(tok::kw_namespace)) { in ParseUsingDirectiveOrDeclaration()
432 assert(Tok.is(tok::kw_namespace) && "Not 'namespace' token"); in ParseUsingDirective()
437 if (Tok.is(tok::code_completion)) { in ParseUsingDirective()
451 if (SS.isInvalid() || Tok.isNot(tok::identifier)) { in ParseUsingDirective()
454 SkipUntil(tok::semi); in ParseUsingDirective()
465 if (Tok.is(tok::kw___attribute)) { in ParseUsingDirective()
472 if (ExpectAndConsume(tok::semi, in ParseUsingDirective()
475 SkipUntil(tok::semi); in ParseUsingDirective()
509 if (TryConsumeToken(tok::kw_typename, TypenameLoc)) in ParseUsingDeclaration()
512 if (Tok.is(tok::kw___super)) { in ParseUsingDeclaration()
514 SkipUntil(tok::semi); in ParseUsingDeclaration()
527 SkipUntil(tok::semi); in ParseUsingDeclaration()
545 Tok.is(tok::identifier) && NextToken().is(tok::semi) && in ParseUsingDeclaration()
555 /*AllowConstructorName=*/!(Tok.is(tok::identifier) && in ParseUsingDeclaration()
556 NextToken().is(tok::equal)), in ParseUsingDeclaration()
558 SkipUntil(tok::semi); in ParseUsingDeclaration()
568 bool IsAliasDecl = Tok.is(tok::equal); in ParseUsingDeclaration()
606 SkipUntil(tok::semi); in ParseUsingDeclaration()
614 SkipUntil(tok::semi); in ParseUsingDeclaration()
642 if (ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseUsingDeclaration()
646 SkipUntil(tok::semi); in ParseUsingDeclaration()
696 assert(Tok.isOneOf(tok::kw_static_assert, tok::kw__Static_assert) && in ParseStaticAssertDeclaration()
699 if (Tok.is(tok::kw__Static_assert) && !getLangOpts().C11) in ParseStaticAssertDeclaration()
701 if (Tok.is(tok::kw_static_assert)) in ParseStaticAssertDeclaration()
706 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseStaticAssertDeclaration()
708 Diag(Tok, diag::err_expected) << tok::l_paren; in ParseStaticAssertDeclaration()
720 if (Tok.is(tok::r_paren)) { in ParseStaticAssertDeclaration()
728 if (ExpectAndConsume(tok::comma)) { in ParseStaticAssertDeclaration()
729 SkipUntil(tok::semi); in ParseStaticAssertDeclaration()
764 assert(Tok.isOneOf(tok::kw_decltype, tok::annot_decltype) in ParseDecltypeSpecifier()
771 if (Tok.is(tok::annot_decltype)) { in ParseDecltypeSpecifier()
785 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseDecltypeSpecifier()
787 "decltype", tok::r_paren)) { in ParseDecltypeSpecifier()
794 if (Tok.is(tok::kw_auto)) { in ParseDecltypeSpecifier()
816 if (SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch)) { in ParseDecltypeSpecifier()
819 if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) { in ParseDecltypeSpecifier()
824 assert(Tok.is(tok::semi)); in ParseDecltypeSpecifier()
877 Tok.setKind(tok::annot_decltype); in AnnotateExistingDecltypeSpecifier()
888 assert(Tok.is(tok::kw___underlying_type) && in ParseUnderlyingTypeSpecifier()
892 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseUnderlyingTypeSpecifier()
894 "__underlying_type", tok::r_paren)) { in ParseUnderlyingTypeSpecifier()
900 SkipUntil(tok::r_paren, StopAtSemi); in ParseUnderlyingTypeSpecifier()
939 if (Tok.is(tok::kw_typename)) { in ParseBaseTypeSpecifier()
954 if (Tok.isOneOf(tok::kw_decltype, tok::annot_decltype)) { in ParseBaseTypeSpecifier()
968 if (Tok.is(tok::annot_template_id)) { in ParseBaseTypeSpecifier()
974 assert(Tok.is(tok::annot_typename) && "template-id -> type failed"); in ParseBaseTypeSpecifier()
987 if (Tok.isNot(tok::identifier)) { in ParseBaseTypeSpecifier()
995 if (Tok.is(tok::less)) { in ParseBaseTypeSpecifier()
1027 if (Tok.isNot(tok::annot_typename)) in ParseBaseTypeSpecifier()
1068 while (Tok.isOneOf(tok::kw___single_inheritance, in ParseMicrosoftInheritanceClassAttributes()
1069 tok::kw___multiple_inheritance, in ParseMicrosoftInheritanceClassAttributes()
1070 tok::kw___virtual_inheritance)) { in ParseMicrosoftInheritanceClassAttributes()
1085 case tok::semi: // struct foo {...} ; in isValidAfterTypeSpecifier()
1086 case tok::star: // struct foo {...} * P; in isValidAfterTypeSpecifier()
1087 case tok::amp: // struct foo {...} & R = ... in isValidAfterTypeSpecifier()
1088 case tok::ampamp: // struct foo {...} && R = ... in isValidAfterTypeSpecifier()
1089 case tok::identifier: // struct foo {...} V ; in isValidAfterTypeSpecifier()
1090 case tok::r_paren: //(struct foo {...} ) {4} in isValidAfterTypeSpecifier()
1091 case tok::annot_cxxscope: // struct foo {...} a:: b; in isValidAfterTypeSpecifier()
1092 case tok::annot_typename: // struct foo {...} a ::b; in isValidAfterTypeSpecifier()
1093 case tok::annot_template_id: // struct foo {...} a<int> ::b; in isValidAfterTypeSpecifier()
1094 case tok::l_paren: // struct foo {...} ( x); in isValidAfterTypeSpecifier()
1095 case tok::comma: // __builtin_offsetof(struct foo{...} , in isValidAfterTypeSpecifier()
1096 case tok::kw_operator: // struct foo operator ++() {...} in isValidAfterTypeSpecifier()
1097 case tok::kw___declspec: // struct foo {...} __declspec(...) in isValidAfterTypeSpecifier()
1098 case tok::l_square: // void f(struct f [ 3]) in isValidAfterTypeSpecifier()
1099 case tok::ellipsis: // void f(struct f ... [Ns]) in isValidAfterTypeSpecifier()
1102 case tok::kw___attribute: // struct foo __attribute__((used)) x; in isValidAfterTypeSpecifier()
1103 case tok::annot_pragma_pack: // struct foo {...} _Pragma(pack(pop)); in isValidAfterTypeSpecifier()
1105 case tok::annot_pragma_ms_pragma: in isValidAfterTypeSpecifier()
1107 case tok::annot_pragma_ms_vtordisp: in isValidAfterTypeSpecifier()
1109 case tok::annot_pragma_ms_pointers_to_members: in isValidAfterTypeSpecifier()
1111 case tok::colon: in isValidAfterTypeSpecifier()
1114 case tok::kw___cdecl: // struct foo {...} __cdecl x; in isValidAfterTypeSpecifier()
1115 case tok::kw___fastcall: // struct foo {...} __fastcall x; in isValidAfterTypeSpecifier()
1116 case tok::kw___stdcall: // struct foo {...} __stdcall x; in isValidAfterTypeSpecifier()
1117 case tok::kw___thiscall: // struct foo {...} __thiscall x; in isValidAfterTypeSpecifier()
1118 case tok::kw___vectorcall: // struct foo {...} __vectorcall x; in isValidAfterTypeSpecifier()
1123 case tok::kw_const: // struct foo {...} const x; in isValidAfterTypeSpecifier()
1124 case tok::kw_volatile: // struct foo {...} volatile x; in isValidAfterTypeSpecifier()
1125 case tok::kw_restrict: // struct foo {...} restrict x; in isValidAfterTypeSpecifier()
1126 case tok::kw__Atomic: // struct foo {...} _Atomic x; in isValidAfterTypeSpecifier()
1127 case tok::kw___unaligned: // struct foo {...} __unaligned *x; in isValidAfterTypeSpecifier()
1131 case tok::kw_inline: // struct foo inline f(); in isValidAfterTypeSpecifier()
1132 case tok::kw_virtual: // struct foo virtual f(); in isValidAfterTypeSpecifier()
1133 case tok::kw_friend: // struct foo friend f(); in isValidAfterTypeSpecifier()
1135 case tok::kw_static: // struct foo {...} static x; in isValidAfterTypeSpecifier()
1136 case tok::kw_extern: // struct foo {...} extern x; in isValidAfterTypeSpecifier()
1137 case tok::kw_typedef: // struct foo {...} typedef x; in isValidAfterTypeSpecifier()
1138 case tok::kw_register: // struct foo {...} register x; in isValidAfterTypeSpecifier()
1139 case tok::kw_auto: // struct foo {...} auto x; in isValidAfterTypeSpecifier()
1140 case tok::kw_mutable: // struct foo {...} mutable x; in isValidAfterTypeSpecifier()
1141 case tok::kw_thread_local: // struct foo {...} thread_local x; in isValidAfterTypeSpecifier()
1142 case tok::kw_constexpr: // struct foo {...} constexpr x; in isValidAfterTypeSpecifier()
1161 case tok::r_brace: // struct bar { struct foo {...} } in isValidAfterTypeSpecifier()
1166 case tok::greater: in isValidAfterTypeSpecifier()
1213 void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, in ParseClassSpecifier()
1220 if (TagTokKind == tok::kw_struct) in ParseClassSpecifier()
1222 else if (TagTokKind == tok::kw___interface) in ParseClassSpecifier()
1224 else if (TagTokKind == tok::kw_class) in ParseClassSpecifier()
1227 assert(TagTokKind == tok::kw_union && "Not a class specifier"); in ParseClassSpecifier()
1231 if (Tok.is(tok::code_completion)) { in ParseClassSpecifier()
1258 if (Tok.isOneOf(tok::kw___single_inheritance, in ParseClassSpecifier()
1259 tok::kw___multiple_inheritance, in ParseClassSpecifier()
1260 tok::kw___virtual_inheritance)) in ParseClassSpecifier()
1273 Tok.isNot(tok::identifier) && in ParseClassSpecifier()
1276 Tok.isOneOf(tok::kw___is_abstract, in ParseClassSpecifier()
1277 tok::kw___is_arithmetic, in ParseClassSpecifier()
1278 tok::kw___is_array, in ParseClassSpecifier()
1279 tok::kw___is_assignable, in ParseClassSpecifier()
1280 tok::kw___is_base_of, in ParseClassSpecifier()
1281 tok::kw___is_class, in ParseClassSpecifier()
1282 tok::kw___is_complete_type, in ParseClassSpecifier()
1283 tok::kw___is_compound, in ParseClassSpecifier()
1284 tok::kw___is_const, in ParseClassSpecifier()
1285 tok::kw___is_constructible, in ParseClassSpecifier()
1286 tok::kw___is_convertible, in ParseClassSpecifier()
1287 tok::kw___is_convertible_to, in ParseClassSpecifier()
1288 tok::kw___is_destructible, in ParseClassSpecifier()
1289 tok::kw___is_empty, in ParseClassSpecifier()
1290 tok::kw___is_enum, in ParseClassSpecifier()
1291 tok::kw___is_floating_point, in ParseClassSpecifier()
1292 tok::kw___is_final, in ParseClassSpecifier()
1293 tok::kw___is_function, in ParseClassSpecifier()
1294 tok::kw___is_fundamental, in ParseClassSpecifier()
1295 tok::kw___is_integral, in ParseClassSpecifier()
1296 tok::kw___is_interface_class, in ParseClassSpecifier()
1297 tok::kw___is_literal, in ParseClassSpecifier()
1298 tok::kw___is_lvalue_expr, in ParseClassSpecifier()
1299 tok::kw___is_lvalue_reference, in ParseClassSpecifier()
1300 tok::kw___is_member_function_pointer, in ParseClassSpecifier()
1301 tok::kw___is_member_object_pointer, in ParseClassSpecifier()
1302 tok::kw___is_member_pointer, in ParseClassSpecifier()
1303 tok::kw___is_nothrow_assignable, in ParseClassSpecifier()
1304 tok::kw___is_nothrow_constructible, in ParseClassSpecifier()
1305 tok::kw___is_nothrow_destructible, in ParseClassSpecifier()
1306 tok::kw___is_object, in ParseClassSpecifier()
1307 tok::kw___is_pod, in ParseClassSpecifier()
1308 tok::kw___is_pointer, in ParseClassSpecifier()
1309 tok::kw___is_polymorphic, in ParseClassSpecifier()
1310 tok::kw___is_reference, in ParseClassSpecifier()
1311 tok::kw___is_rvalue_expr, in ParseClassSpecifier()
1312 tok::kw___is_rvalue_reference, in ParseClassSpecifier()
1313 tok::kw___is_same, in ParseClassSpecifier()
1314 tok::kw___is_scalar, in ParseClassSpecifier()
1315 tok::kw___is_sealed, in ParseClassSpecifier()
1316 tok::kw___is_signed, in ParseClassSpecifier()
1317 tok::kw___is_standard_layout, in ParseClassSpecifier()
1318 tok::kw___is_trivial, in ParseClassSpecifier()
1319 tok::kw___is_trivially_assignable, in ParseClassSpecifier()
1320 tok::kw___is_trivially_constructible, in ParseClassSpecifier()
1321 tok::kw___is_trivially_copyable, in ParseClassSpecifier()
1322 tok::kw___is_union, in ParseClassSpecifier()
1323 tok::kw___is_unsigned, in ParseClassSpecifier()
1324 tok::kw___is_void, in ParseClassSpecifier()
1325 tok::kw___is_volatile)) in ParseClassSpecifier()
1338 assert(Tok.is(tok::kw__Atomic)); in ParseClassSpecifier()
1341 Tok.setKind(tok::identifier); in ParseClassSpecifier()
1346 AtomicII->revertIdentifierToTokenID(tok::kw__Atomic); in ParseClassSpecifier()
1357 Tok.is(tok::kw__Atomic) && in ParseClassSpecifier()
1376 if (Tok.isNot(tok::identifier) && Tok.isNot(tok::annot_template_id)) { in ParseClassSpecifier()
1377 Diag(Tok, diag::err_expected) << tok::identifier; in ParseClassSpecifier()
1390 if (Tok.is(tok::identifier)) { in ParseClassSpecifier()
1394 if (Tok.is(tok::less) && getLangOpts().CPlusPlus) { in ParseClassSpecifier()
1433 } else if (Tok.is(tok::annot_template_id)) { in ParseClassSpecifier()
1451 SkipUntil(tok::semi, StopBeforeMatch); in ParseClassSpecifier()
1488 else if (Tok.is(tok::l_brace) || in ParseClassSpecifier()
1489 (getLangOpts().CPlusPlus && Tok.is(tok::colon)) || in ParseClassSpecifier()
1491 (NextToken().is(tok::l_brace) || NextToken().is(tok::colon)))) { in ParseClassSpecifier()
1500 SkipUntil(tok::semi, StopBeforeMatch); in ParseClassSpecifier()
1506 } else if (isCXX11FinalKeyword() && (NextToken().is(tok::l_square) || in ParseClassSpecifier()
1507 NextToken().is(tok::kw_alignas))) { in ParseClassSpecifier()
1517 if (Tok.is(tok::l_square) && NextToken().is(tok::l_square)) { in ParseClassSpecifier()
1519 if (!SkipUntil(tok::r_square, StopAtSemi)) in ParseClassSpecifier()
1521 } else if (Tok.is(tok::kw_alignas) && NextToken().is(tok::l_paren)) { in ParseClassSpecifier()
1524 if (!SkipUntil(tok::r_paren, StopAtSemi)) in ParseClassSpecifier()
1531 if (Tok.isOneOf(tok::l_brace, tok::colon)) in ParseClassSpecifier()
1538 (Tok.is(tok::semi) || in ParseClassSpecifier()
1541 if (Tok.isNot(tok::semi)) { in ParseClassSpecifier()
1544 ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseClassSpecifier()
1547 Tok.setKind(tok::semi); in ParseClassSpecifier()
1593 if (TUK == Sema::TUK_Definition && Tok.is(tok::colon)) in ParseClassSpecifier()
1594 SkipUntil(tok::semi, StopBeforeMatch); in ParseClassSpecifier()
1596 SkipUntil(tok::comma, StopAtSemi); in ParseClassSpecifier()
1768 assert(Tok.is(tok::l_brace) || in ParseClassSpecifier()
1769 (getLangOpts().CPlusPlus && Tok.is(tok::colon)) || in ParseClassSpecifier()
1816 if (Tok.isNot(tok::semi)) { in ParseClassSpecifier()
1818 ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseClassSpecifier()
1824 Tok.setKind(tok::semi); in ParseClassSpecifier()
1837 assert(Tok.is(tok::colon) && "Not a base clause"); in ParseBaseClause()
1849 SkipUntil(tok::comma, tok::l_brace, StopAtSemi | StopBeforeMatch); in ParseBaseClause()
1857 if (!TryConsumeToken(tok::comma)) in ParseBaseClause()
1884 if (TryConsumeToken(tok::kw_virtual)) in ParseBaseSpecifier()
1898 if (Tok.is(tok::kw_virtual)) { in ParseBaseSpecifier()
1917 if (getLangOpts().MSVCCompat && Tok.is(tok::kw__Atomic) && in ParseBaseSpecifier()
1918 NextToken().is(tok::less)) in ParseBaseSpecifier()
1919 Tok.setKind(tok::identifier); in ParseBaseSpecifier()
1931 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseBaseSpecifier()
1953 case tok::kw_private: return AS_private; in getAccessSpecifierIfPresent()
1954 case tok::kw_protected: return AS_protected; in getAccessSpecifierIfPresent()
1955 case tok::kw_public: return AS_public; in getAccessSpecifierIfPresent()
2009 if (!getLangOpts().CPlusPlus || Tok.isNot(tok::identifier)) in isCXX11VirtSpecifier()
2098 if (Tok.isNot(tok::colon)) in ParseCXXMemberDeclaratorBeforeInitializer()
2103 if (!DeclaratorInfo.isFunctionDeclarator() && TryConsumeToken(tok::colon)) { in ParseCXXMemberDeclaratorBeforeInitializer()
2108 SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXXMemberDeclaratorBeforeInitializer()
2118 if (Tok.is(tok::kw_asm)) { in ParseCXXMemberDeclaratorBeforeInitializer()
2122 SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXXMemberDeclaratorBeforeInitializer()
2154 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseCXXMemberDeclaratorBeforeInitializer()
2263 if (Tok.is(tok::at)) { in ParseCXXClassMemberDeclaration()
2264 if (getLangOpts().ObjC1 && NextToken().isObjCAtKeyword(tok::objc_defs)) in ParseCXXClassMemberDeclaration()
2270 SkipUntil(tok::r_brace, StopAtSemi); in ParseCXXClassMemberDeclaration()
2285 Tok.isOneOf(tok::identifier, tok::coloncolon, tok::kw___super)) { in ParseCXXClassMemberDeclaration()
2290 if (Tok.isNot(tok::annot_cxxscope)) in ParseCXXClassMemberDeclaration()
2292 else if (NextToken().is(tok::identifier)) in ParseCXXClassMemberDeclaration()
2293 isAccessDecl = GetLookAheadToken(2).is(tok::semi); in ParseCXXClassMemberDeclaration()
2295 isAccessDecl = NextToken().is(tok::kw_operator); in ParseCXXClassMemberDeclaration()
2304 SkipUntil(tok::semi); in ParseCXXClassMemberDeclaration()
2313 SkipUntil(tok::semi); in ParseCXXClassMemberDeclaration()
2318 if (ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseCXXClassMemberDeclaration()
2320 SkipUntil(tok::semi); in ParseCXXClassMemberDeclaration()
2335 Tok.isOneOf(tok::kw_static_assert, tok::kw__Static_assert)) { in ParseCXXClassMemberDeclaration()
2341 if (Tok.is(tok::kw_template)) { in ParseCXXClassMemberDeclaration()
2351 if (Tok.is(tok::kw___extension__)) { in ParseCXXClassMemberDeclaration()
2370 if (Tok.is(tok::kw_using)) { in ParseCXXClassMemberDeclaration()
2376 if (Tok.is(tok::kw_namespace)) { in ParseCXXClassMemberDeclaration()
2378 SkipUntil(tok::semi, StopBeforeMatch); in ParseCXXClassMemberDeclaration()
2416 if (TryConsumeToken(tok::semi)) { in ParseCXXClassMemberDeclaration()
2441 if (Tok.isNot(tok::equal)) in ParseCXXClassMemberDeclaration()
2446 if (Zero.isNot(tok::numeric_constant) || Zero.getLength() != 1 || in ParseCXXClassMemberDeclaration()
2451 if (!After.isOneOf(tok::semi, tok::comma) && in ParseCXXClassMemberDeclaration()
2453 After.isOneOf(tok::l_brace, tok::colon, tok::kw_try))) in ParseCXXClassMemberDeclaration()
2468 TryConsumeToken(tok::semi); in ParseCXXClassMemberDeclaration()
2485 if (Tok.is(tok::l_brace) && !getLangOpts().CPlusPlus11) { in ParseCXXClassMemberDeclaration()
2488 if (Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try)) { in ParseCXXClassMemberDeclaration()
2490 } else if (Tok.is(tok::equal)) { in ParseCXXClassMemberDeclaration()
2492 if (KW.is(tok::kw_default)) in ParseCXXClassMemberDeclaration()
2494 else if (KW.is(tok::kw_delete)) in ParseCXXClassMemberDeclaration()
2513 SkipUntil(tok::r_brace); in ParseCXXClassMemberDeclaration()
2516 TryConsumeToken(tok::semi); in ParseCXXClassMemberDeclaration()
2544 if (Tok.is(tok::semi)) in ParseCXXClassMemberDeclaration()
2558 if (Tok.isOneOf(tok::equal, tok::l_brace) && PureSpecLoc.isInvalid()) { in ParseCXXClassMemberDeclaration()
2561 SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXXClassMemberDeclaration()
2573 HasInClassInit = Tok.is(tok::equal) ? ICIS_CopyInit : ICIS_ListInit; in ParseCXXClassMemberDeclaration()
2641 SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXXClassMemberDeclaration()
2654 SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXXClassMemberDeclaration()
2686 if (!TryConsumeToken(tok::comma, CommaLoc)) in ParseCXXClassMemberDeclaration()
2716 ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list)) { in ParseCXXClassMemberDeclaration()
2718 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseCXXClassMemberDeclaration()
2720 TryConsumeToken(tok::semi); in ParseCXXClassMemberDeclaration()
2749 assert(Tok.isOneOf(tok::equal, tok::l_brace) in ParseCXXMemberInitializer()
2755 if (TryConsumeToken(tok::equal, EqualLoc)) { in ParseCXXMemberInitializer()
2756 if (Tok.is(tok::kw_delete)) { in ParseCXXMemberInitializer()
2763 if (IsFunction || Next.isOneOf(tok::semi, tok::comma, tok::eof)) { in ParseCXXMemberInitializer()
2771 } else if (Tok.is(tok::kw_default)) { in ParseCXXMemberInitializer()
2791 if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) { in SkipCXXMemberSpecification()
2803 if (Tok.isNot(tok::colon) && Tok.isNot(tok::l_brace)) in SkipCXXMemberSpecification()
2810 if (Tok.is(tok::colon)) { in SkipCXXMemberSpecification()
2823 if (!Tok.is(tok::l_brace)) { in SkipCXXMemberSpecification()
2831 assert(Tok.is(tok::l_brace)); in SkipCXXMemberSpecification()
2832 BalancedDelimiterTracker T(*this, tok::l_brace); in SkipCXXMemberSpecification()
2838 if (Tok.is(tok::kw___attribute)) in SkipCXXMemberSpecification()
2846 Tok.isOneOf(tok::kw___if_exists, tok::kw___if_not_exists)) { in ParseCXXClassMemberDeclarationWithPragmas()
2852 if (Tok.is(tok::semi)) { in ParseCXXClassMemberDeclarationWithPragmas()
2857 if (Tok.is(tok::annot_pragma_vis)) { in ParseCXXClassMemberDeclarationWithPragmas()
2862 if (Tok.is(tok::annot_pragma_pack)) { in ParseCXXClassMemberDeclarationWithPragmas()
2867 if (Tok.is(tok::annot_pragma_align)) { in ParseCXXClassMemberDeclarationWithPragmas()
2872 if (Tok.is(tok::annot_pragma_ms_pointers_to_members)) { in ParseCXXClassMemberDeclarationWithPragmas()
2877 if (Tok.is(tok::annot_pragma_ms_pragma)) { in ParseCXXClassMemberDeclarationWithPragmas()
2882 if (Tok.is(tok::annot_pragma_ms_vtordisp)) { in ParseCXXClassMemberDeclarationWithPragmas()
2888 if (Tok.is(tok::kw_namespace)) { in ParseCXXClassMemberDeclarationWithPragmas()
2904 if (TryConsumeToken(tok::colon, EndLoc)) { in ParseCXXClassMemberDeclarationWithPragmas()
2905 } else if (TryConsumeToken(tok::semi, EndLoc)) { in ParseCXXClassMemberDeclarationWithPragmas()
2907 << tok::colon << FixItHint::CreateReplacement(EndLoc, ":"); in ParseCXXClassMemberDeclarationWithPragmas()
2911 << tok::colon << FixItHint::CreateInsertion(EndLoc, ":"); in ParseCXXClassMemberDeclarationWithPragmas()
2929 if (Tok.is(tok::annot_pragma_openmp)) in ParseCXXClassMemberDeclarationWithPragmas()
2996 if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) { in ParseCXXMemberSpecification()
3028 if (!Tok.is(tok::colon) && !Tok.is(tok::l_brace)) { in ParseCXXMemberSpecification()
3035 if (Tok.is(tok::colon)) { in ParseCXXMemberSpecification()
3037 if (!Tok.is(tok::l_brace)) { in ParseCXXMemberSpecification()
3042 case tok::kw_private: in ParseCXXMemberSpecification()
3043 case tok::kw_protected: in ParseCXXMemberSpecification()
3044 case tok::kw_public: in ParseCXXMemberSpecification()
3045 SuggestFixIt = NextToken().getKind() == tok::colon; in ParseCXXMemberSpecification()
3047 case tok::kw_static_assert: in ParseCXXMemberSpecification()
3048 case tok::r_brace: in ParseCXXMemberSpecification()
3049 case tok::kw_using: in ParseCXXMemberSpecification()
3051 case tok::kw_template: in ParseCXXMemberSpecification()
3054 case tok::identifier: in ParseCXXMemberSpecification()
3068 Tok.setKind(tok::l_brace); in ParseCXXMemberSpecification()
3077 assert(Tok.is(tok::l_brace)); in ParseCXXMemberSpecification()
3078 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseCXXMemberSpecification()
3098 while (!tryParseMisplacedModuleImport() && Tok.isNot(tok::r_brace) && in ParseCXXMemberSpecification()
3099 Tok.isNot(tok::eof)) { in ParseCXXMemberSpecification()
3106 SkipUntil(tok::r_brace); in ParseCXXMemberSpecification()
3155 assert(Tok.is(tok::kw_namespace)); in DiagnoseUnexpectedNamespace()
3169 Tok.setKind(tok::semi); in DiagnoseUnexpectedNamespace()
3172 Tok.setKind(tok::r_brace); in DiagnoseUnexpectedNamespace()
3197 assert(Tok.is(tok::colon) && in ParseConstructorInitializer()
3209 if (Tok.is(tok::code_completion)) { in ParseConstructorInitializer()
3221 if (Tok.is(tok::comma)) in ParseConstructorInitializer()
3223 else if (Tok.is(tok::l_brace)) in ParseConstructorInitializer()
3228 Tok.isOneOf(tok::identifier, tok::coloncolon)) { in ParseConstructorInitializer()
3235 Diag(Tok.getLocation(), diag::err_expected_either) << tok::l_brace in ParseConstructorInitializer()
3236 << tok::comma; in ParseConstructorInitializer()
3237 SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch); in ParseConstructorInitializer()
3263 if (Tok.is(tok::annot_template_id)) { in ParseMemInitializer()
3268 assert(Tok.is(tok::annot_typename) && "template-id -> type failed"); in ParseMemInitializer()
3274 if (!TemplateTypeTy && Tok.isNot(tok::identifier) in ParseMemInitializer()
3275 && Tok.isNot(tok::annot_decltype)) { in ParseMemInitializer()
3283 if (Tok.is(tok::annot_decltype)) { in ParseMemInitializer()
3287 if (Tok.is(tok::identifier)) in ParseMemInitializer()
3296 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { in ParseMemInitializer()
3304 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseMemInitializer()
3309 } else if(Tok.is(tok::l_paren)) { in ParseMemInitializer()
3310 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseMemInitializer()
3316 if (Tok.isNot(tok::r_paren) && ParseExpressionList(ArgExprs, CommaLocs)) { in ParseMemInitializer()
3317 SkipUntil(tok::r_paren, StopAtSemi); in ParseMemInitializer()
3324 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseMemInitializer()
3333 return Diag(Tok, diag::err_expected_either) << tok::l_paren << tok::l_brace; in ParseMemInitializer()
3335 return Diag(Tok, diag::err_expected) << tok::l_paren; in ParseMemInitializer()
3359 if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept)) in tryParseExceptionSpecification()
3363 bool IsNoexcept = Tok.is(tok::kw_noexcept); in tryParseExceptionSpecification()
3368 if (!Tok.is(tok::l_paren)) { in tryParseExceptionSpecification()
3386 ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens, in tryParseExceptionSpecification()
3395 if (Tok.is(tok::kw_throw)) { in tryParseExceptionSpecification()
3404 if (Tok.isNot(tok::kw_noexcept)) in tryParseExceptionSpecification()
3415 if (Tok.is(tok::l_paren)) { in tryParseExceptionSpecification()
3417 BalancedDelimiterTracker T(*this, tok::l_paren); in tryParseExceptionSpecification()
3444 if (Tok.is(tok::kw_throw)) { in tryParseExceptionSpecification()
3481 assert(Tok.is(tok::kw_throw) && "expected throw"); in ParseDynamicExceptionSpecification()
3484 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseDynamicExceptionSpecification()
3493 if (Tok.is(tok::ellipsis)) { in ParseDynamicExceptionSpecification()
3505 while (Tok.isNot(tok::r_paren)) { in ParseDynamicExceptionSpecification()
3508 if (Tok.is(tok::ellipsis)) { in ParseDynamicExceptionSpecification()
3523 if (!TryConsumeToken(tok::comma)) in ParseDynamicExceptionSpecification()
3537 assert(Tok.is(tok::arrow) && "expected arrow"); in ParseTrailingReturnType()
3623 case tok::ampamp: // 'and' in TryParseCXX11AttributeIdentifier()
3624 case tok::pipe: // 'bitor' in TryParseCXX11AttributeIdentifier()
3625 case tok::pipepipe: // 'or' in TryParseCXX11AttributeIdentifier()
3626 case tok::caret: // 'xor' in TryParseCXX11AttributeIdentifier()
3627 case tok::tilde: // 'compl' in TryParseCXX11AttributeIdentifier()
3628 case tok::amp: // 'bitand' in TryParseCXX11AttributeIdentifier()
3629 case tok::ampequal: // 'and_eq' in TryParseCXX11AttributeIdentifier()
3630 case tok::pipeequal: // 'or_eq' in TryParseCXX11AttributeIdentifier()
3631 case tok::caretequal: // 'xor_eq' in TryParseCXX11AttributeIdentifier()
3632 case tok::exclaim: // 'not' in TryParseCXX11AttributeIdentifier()
3633 case tok::exclaimequal: // 'not_eq' in TryParseCXX11AttributeIdentifier()
3686 assert(Tok.is(tok::l_paren) && "Not a C++11 attribute argument list"); in ParseCXX11AttributeArgs()
3695 SkipUntil(tok::r_paren); in ParseCXX11AttributeArgs()
3760 if (Tok.is(tok::kw_alignas)) { in ParseCXX11AttributeSpecifier()
3766 assert(Tok.is(tok::l_square) && NextToken().is(tok::l_square) in ParseCXX11AttributeSpecifier()
3776 if (Tok.is(tok::kw_using)) { in ParseCXX11AttributeSpecifier()
3784 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier; in ParseCXX11AttributeSpecifier()
3785 SkipUntil(tok::r_square, tok::colon, StopBeforeMatch); in ParseCXX11AttributeSpecifier()
3787 if (!TryConsumeToken(tok::colon) && CommonScopeName) in ParseCXX11AttributeSpecifier()
3788 Diag(Tok.getLocation(), diag::err_expected) << tok::colon; in ParseCXX11AttributeSpecifier()
3793 while (Tok.isNot(tok::r_square)) { in ParseCXX11AttributeSpecifier()
3795 if (TryConsumeToken(tok::comma)) in ParseCXX11AttributeSpecifier()
3807 if (TryConsumeToken(tok::coloncolon)) { in ParseCXX11AttributeSpecifier()
3813 Diag(Tok.getLocation(), diag::err_expected) << tok::identifier; in ParseCXX11AttributeSpecifier()
3814 SkipUntil(tok::r_square, tok::comma, StopAtSemi | StopBeforeMatch); in ParseCXX11AttributeSpecifier()
3838 if (Tok.is(tok::l_paren)) in ParseCXX11AttributeSpecifier()
3848 if (TryConsumeToken(tok::ellipsis)) in ParseCXX11AttributeSpecifier()
3853 if (ExpectAndConsume(tok::r_square)) in ParseCXX11AttributeSpecifier()
3854 SkipUntil(tok::r_square); in ParseCXX11AttributeSpecifier()
3857 if (ExpectAndConsume(tok::r_square)) in ParseCXX11AttributeSpecifier()
3858 SkipUntil(tok::r_square); in ParseCXX11AttributeSpecifier()
3899 if (Tok.is(tok::l_square)) { in SkipCXX11Attributes()
3900 BalancedDelimiterTracker T(*this, tok::l_square); in SkipCXX11Attributes()
3905 assert(Tok.is(tok::kw_alignas) && "not an attribute specifier"); in SkipCXX11Attributes()
3907 BalancedDelimiterTracker T(*this, tok::l_paren); in SkipCXX11Attributes()
3927 assert(Tok.is(tok::l_square) && "Not a Microsoft attribute list"); in ParseMicrosoftAttributes()
3931 BalancedDelimiterTracker T(*this, tok::l_square); in ParseMicrosoftAttributes()
3933 SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch); in ParseMicrosoftAttributes()
3937 } while (Tok.is(tok::l_square)); in ParseMicrosoftAttributes()
3946 BalancedDelimiterTracker Braces(*this, tok::l_brace); in ParseMicrosoftIfExistsClassDeclaration()
3948 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseMicrosoftIfExistsClassDeclaration()
3967 while (Tok.isNot(tok::r_brace) && !isEofOrEom()) { in ParseMicrosoftIfExistsClassDeclaration()
3969 if (Tok.isOneOf(tok::kw___if_exists, tok::kw___if_not_exists)) { in ParseMicrosoftIfExistsClassDeclaration()
3975 if (Tok.is(tok::semi)) { in ParseMicrosoftIfExistsClassDeclaration()
3986 if (Tok.is(tok::colon)) in ParseMicrosoftIfExistsClassDeclaration()
3989 Diag(Tok, diag::err_expected) << tok::colon; in ParseMicrosoftIfExistsClassDeclaration()