@@ -1802,7 +1802,7 @@ void Parser::AnnotateScopeToken(CXXScopeSpec &SS, bool IsNewAnnotation) {
1802
1802
// / \param AllowImplicitTypename Whether we are in a context where a dependent
1803
1803
// / nested-name-specifier without typename is treated as a type (e.g.
1804
1804
// / T::type).
1805
- Parser:: AnnotatedNameKind
1805
+ AnnotatedNameKind
1806
1806
Parser::TryAnnotateName (CorrectionCandidateCallback *CCC,
1807
1807
ImplicitTypenameContext AllowImplicitTypename) {
1808
1808
assert (Tok.is (tok::identifier) || Tok.is (tok::annot_cxxscope));
@@ -1815,13 +1815,13 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1815
1815
ParseOptionalCXXScopeSpecifier (SS, /* ObjectType=*/ nullptr ,
1816
1816
/* ObjectHasErrors=*/ false ,
1817
1817
EnteringContext))
1818
- return ANK_Error ;
1818
+ return AnnotatedNameKind::Error ;
1819
1819
1820
1820
if (Tok.isNot (tok::identifier) || SS.isInvalid ()) {
1821
1821
if (TryAnnotateTypeOrScopeTokenAfterScopeSpec (SS, !WasScopeAnnotation,
1822
1822
AllowImplicitTypename))
1823
- return ANK_Error ;
1824
- return ANK_Unresolved ;
1823
+ return AnnotatedNameKind::Error ;
1824
+ return AnnotatedNameKind::Unresolved ;
1825
1825
}
1826
1826
1827
1827
IdentifierInfo *Name = Tok.getIdentifierInfo ();
@@ -1834,8 +1834,9 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1834
1834
// an expression. Fall back to annotating it as a type.
1835
1835
if (TryAnnotateTypeOrScopeTokenAfterScopeSpec (SS, !WasScopeAnnotation,
1836
1836
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;
1839
1840
}
1840
1841
1841
1842
Token Next = NextToken ();
@@ -1863,7 +1864,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1863
1864
1864
1865
switch (Classification.getKind ()) {
1865
1866
case Sema::NC_Error:
1866
- return ANK_Error ;
1867
+ return AnnotatedNameKind::Error ;
1867
1868
1868
1869
case Sema::NC_Keyword:
1869
1870
// The identifier was typo-corrected to a keyword.
@@ -1873,7 +1874,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1873
1874
if (SS.isNotEmpty ())
1874
1875
AnnotateScopeToken (SS, !WasScopeAnnotation);
1875
1876
// We've "annotated" this as a keyword.
1876
- return ANK_Success ;
1877
+ return AnnotatedNameKind::Success ;
1877
1878
1878
1879
case Sema::NC_Unknown:
1879
1880
// It's not something we know about. Leave it unannotated.
@@ -1905,15 +1906,15 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1905
1906
if (NewType.isUsable ())
1906
1907
Ty = NewType.get ();
1907
1908
else if (Tok.is (tok::eof)) // Nothing to do here, bail out...
1908
- return ANK_Error ;
1909
+ return AnnotatedNameKind::Error ;
1909
1910
}
1910
1911
1911
1912
Tok.setKind (tok::annot_typename);
1912
1913
setTypeAnnotation (Tok, Ty);
1913
1914
Tok.setAnnotationEndLoc (Tok.getLocation ());
1914
1915
Tok.setLocation (BeginLoc);
1915
1916
PP.AnnotateCachedTokens (Tok);
1916
- return ANK_Success ;
1917
+ return AnnotatedNameKind::Success ;
1917
1918
}
1918
1919
1919
1920
case Sema::NC_OverloadSet:
@@ -1923,7 +1924,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1923
1924
if (SS.isNotEmpty ())
1924
1925
Tok.setLocation (SS.getBeginLoc ());
1925
1926
PP.AnnotateCachedTokens (Tok);
1926
- return ANK_Success ;
1927
+ return AnnotatedNameKind::Success ;
1927
1928
1928
1929
case Sema::NC_NonType:
1929
1930
if (TryAltiVecVectorToken ())
@@ -1938,7 +1939,7 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1938
1939
PP.AnnotateCachedTokens (Tok);
1939
1940
if (SS.isNotEmpty ())
1940
1941
AnnotateScopeToken (SS, !WasScopeAnnotation);
1941
- return ANK_Success ;
1942
+ return AnnotatedNameKind::Success ;
1942
1943
1943
1944
case Sema::NC_UndeclaredNonType:
1944
1945
case Sema::NC_DependentNonType:
@@ -1951,14 +1952,14 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1951
1952
PP.AnnotateCachedTokens (Tok);
1952
1953
if (SS.isNotEmpty ())
1953
1954
AnnotateScopeToken (SS, !WasScopeAnnotation);
1954
- return ANK_Success ;
1955
+ return AnnotatedNameKind::Success ;
1955
1956
1956
1957
case Sema::NC_TypeTemplate:
1957
1958
if (Next.isNot (tok::less)) {
1958
1959
// This may be a type template being used as a template template argument.
1959
1960
if (SS.isNotEmpty ())
1960
1961
AnnotateScopeToken (SS, !WasScopeAnnotation);
1961
- return ANK_TemplateName ;
1962
+ return AnnotatedNameKind::TemplateName ;
1962
1963
}
1963
1964
[[fallthrough]];
1964
1965
case Sema::NC_Concept:
@@ -1977,17 +1978,17 @@ Parser::TryAnnotateName(CorrectionCandidateCallback *CCC,
1977
1978
Classification.getTemplateNameKind (), SS, SourceLocation (), Id,
1978
1979
/* AllowTypeAnnotation=*/ !IsConceptName,
1979
1980
/* TypeConstraint=*/ IsConceptName))
1980
- return ANK_Error ;
1981
+ return AnnotatedNameKind::Error ;
1981
1982
if (SS.isNotEmpty ())
1982
1983
AnnotateScopeToken (SS, !WasScopeAnnotation);
1983
- return ANK_Success ;
1984
+ return AnnotatedNameKind::Success ;
1984
1985
}
1985
1986
}
1986
1987
1987
1988
// Unable to classify the name, but maybe we can annotate a scope specifier.
1988
1989
if (SS.isNotEmpty ())
1989
1990
AnnotateScopeToken (SS, !WasScopeAnnotation);
1990
- return ANK_Unresolved ;
1991
+ return AnnotatedNameKind::Unresolved ;
1991
1992
}
1992
1993
1993
1994
bool Parser::TryKeywordIdentFallback (bool DisableKeyword) {
0 commit comments