================
@@ -357,10 +357,12 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, 
SourceLocation NameLoc,
       return nullptr;
   }
 
-  // FIXME: LookupNestedNameSpecifierName isn't the right kind of
-  // lookup for class-names.
-  LookupNameKind Kind = isClassName ? LookupNestedNameSpecifierName :
-                                      LookupOrdinaryName;
+  // In case we know that the identifier is a class name, we know that it is
+  // a type declaration (struct, class, union or enum) so we can use tag name
+  // lookup:
+  // The lookup for the component name of the type-name or simple-template-id
+  // is type-only ([basic.lookup]).
----------------
Sirraide wrote:

```suggestion
  // In case we know that the identifier is a class name, we know that it is
  // a type declaration (struct, class, union or enum) so we can use tag name
  // lookup.
  //
  // C++ [class.derived]p2 (wrt lookup in a base-specifier): The lookup for 
  // the component name of the type-name or simple-template-id is type-only.
```
I think this is a bit clearer.

https://github.com/llvm/llvm-project/pull/112166
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to