@@ -1802,7 +1802,7 @@ void Parser::AnnotateScopeToken(CXXScopeSpec &SS, bool IsNewAnnotation) {
18021802// / \param AllowImplicitTypename Whether we are in a context where a dependent
18031803// / nested-name-specifier without typename is treated as a type (e.g.
18041804// / T::type).
1805- Parser:: AnnotatedNameKind
1805+ AnnotatedNameKind
18061806Parser::TryAnnotateName (CorrectionCandidateCallback *CCC,
18071807 ImplicitTypenameContext AllowImplicitTypename) {
18081808 assert (Tok.is (tok::identifier) || Tok.is (tok::annot_cxxscope));
@@ -1815,13 +1815,13 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
18151815 ParseOptionalCXXScopeSpecifier (SS, /* ObjectType=*/ nullptr ,
18161816 /* ObjectHasErrors=*/ false ,
18171817 EnteringContext))
1818- return ANK_Error ;
1818+ return AnnotatedNameKind::Error ;
18191819
18201820 if (Tok.isNot (tok::identifier) || SS.isInvalid ()) {
18211821 if (TryAnnotateTypeOrScopeTokenAfterScopeSpec (SS, !WasScopeAnnotation,
18221822 AllowImplicitTypename))
1823- return ANK_Error ;
1824- return ANK_Unresolved ;
1823+ return AnnotatedNameKind::Error ;
1824+ return AnnotatedNameKind::Unresolved ;
18251825 }
18261826
18271827 IdentifierInfo *Name = Tok.getIdentifierInfo ();
@@ -1834,8 +1834,9 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
18341834 // an expression. Fall back to annotating it as a type.
18351835 if (TryAnnotateTypeOrScopeTokenAfterScopeSpec (SS, !WasScopeAnnotation,
18361836 AllowImplicitTypename))
1837- return ANK_Error;
1838- return Tok.is (tok::annot_typename) ? ANK_Success : ANK_TentativeDecl;
1837+ return AnnotatedNameKind::Error;
1838+ return Tok.is (tok::annot_typename) ? AnnotatedNameKind::Success
1839+ : AnnotatedNameKind::TentativeDecl;
18391840 }
18401841
18411842 Token Next = NextToken ();
@@ -1863,7 +1864,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
18631864
18641865 switch (Classification.getKind ()) {
18651866 case Sema::NC_Error:
1866- return ANK_Error ;
1867+ return AnnotatedNameKind::Error ;
18671868
18681869 case Sema::NC_Keyword:
18691870 // The identifier was typo-corrected to a keyword.
@@ -1873,7 +1874,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
18731874 if (SS.isNotEmpty ())
18741875 AnnotateScopeToken (SS, !WasScopeAnnotation);
18751876 // We've "annotated" this as a keyword.
1876- return ANK_Success ;
1877+ return AnnotatedNameKind::Success ;
18771878
18781879 case Sema::NC_Unknown:
18791880 // It's not something we know about. Leave it unannotated.
@@ -1905,15 +1906,15 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
19051906 if (NewType.isUsable ())
19061907 Ty = NewType.get ();
19071908 else if (Tok.is (tok::eof)) // Nothing to do here, bail out...
1908- return ANK_Error ;
1909+ return AnnotatedNameKind::Error ;
19091910 }
19101911
19111912 Tok.setKind (tok::annot_typename);
19121913 setTypeAnnotation (Tok, Ty);
19131914 Tok.setAnnotationEndLoc (Tok.getLocation ());
19141915 Tok.setLocation (BeginLoc);
19151916 PP.AnnotateCachedTokens (Tok);
1916- return ANK_Success ;
1917+ return AnnotatedNameKind::Success ;
19171918 }
19181919
19191920 case Sema::NC_OverloadSet:
@@ -1923,7 +1924,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
19231924 if (SS.isNotEmpty ())
19241925 Tok.setLocation (SS.getBeginLoc ());
19251926 PP.AnnotateCachedTokens (Tok);
1926- return ANK_Success ;
1927+ return AnnotatedNameKind::Success ;
19271928
19281929 case Sema::NC_NonType:
19291930 if (TryAltiVecVectorToken ())
@@ -1938,7 +1939,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
19381939 PP.AnnotateCachedTokens (Tok);
19391940 if (SS.isNotEmpty ())
19401941 AnnotateScopeToken (SS, !WasScopeAnnotation);
1941- return ANK_Success ;
1942+ return AnnotatedNameKind::Success ;
19421943
19431944 case Sema::NC_UndeclaredNonType:
19441945 case Sema::NC_DependentNonType:
@@ -1951,14 +1952,14 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
19511952 PP.AnnotateCachedTokens (Tok);
19521953 if (SS.isNotEmpty ())
19531954 AnnotateScopeToken (SS, !WasScopeAnnotation);
1954- return ANK_Success ;
1955+ return AnnotatedNameKind::Success ;
19551956
19561957 case Sema::NC_TypeTemplate:
19571958 if (Next.isNot (tok::less)) {
19581959 // This may be a type template being used as a template template argument.
19591960 if (SS.isNotEmpty ())
19601961 AnnotateScopeToken (SS, !WasScopeAnnotation);
1961- return ANK_TemplateName ;
1962+ return AnnotatedNameKind::TemplateName ;
19621963 }
19631964 [[fallthrough]];
19641965 case Sema::NC_Concept:
@@ -1977,17 +1978,17 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
19771978 Classification.getTemplateNameKind (), SS, SourceLocation (), Id,
19781979 /* AllowTypeAnnotation=*/ !IsConceptName,
19791980 /* TypeConstraint=*/ IsConceptName))
1980- return ANK_Error ;
1981+ return AnnotatedNameKind::Error ;
19811982 if (SS.isNotEmpty ())
19821983 AnnotateScopeToken (SS, !WasScopeAnnotation);
1983- return ANK_Success ;
1984+ return AnnotatedNameKind::Success ;
19841985 }
19851986 }
19861987
19871988 // Unable to classify the name, but maybe we can annotate a scope specifier.
19881989 if (SS.isNotEmpty ())
19891990 AnnotateScopeToken (SS, !WasScopeAnnotation);
1990- return ANK_Unresolved ;
1991+ return AnnotatedNameKind::Unresolved ;
19911992}
19921993
19931994bool Parser::TryKeywordIdentFallback (bool DisableKeyword) {
0 commit comments