[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 05:24:46 PDT 2024


================
@@ -738,16 +738,47 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
       return nullptr;
     }
 
-    if (!Tok.is(tok::identifier)) {
+    Decl *UED = nullptr;
+
+    if (Tok.is(tok::identifier)) {
----------------
cor3ntin wrote:

This assumes that only 2 scenario will occur:

* Either there is an already annotated template
* Or the identifier is not part of a simple-template-id

I am not sure that is correct.
ie there is scenario where we find a `tok::less` after the identifier.

I'd like to understand exactly what happens, in particular:

* Whether that scenario can ever happen (and we should assert otherwise)
* What's the difference between this code and `ParseBaseTypeSpecifier`: Either we can remove a lot of code from  `ParseBaseTypeSpecifier`, or factorize both functions

Afaict, we always get an annotation because `ParseOptionalCXXScopeSpecifier` annotates.
but that should be the case in `ParseBaseTypeSpecifier` too/



https://github.com/llvm/llvm-project/pull/95399


More information about the cfe-commits mailing list