From d4cbb491801bc24ec83b554b1333c277cdbd9c36 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 11 Feb 2025 21:36:11 +0000 Subject: [PATCH] Resolve using declarations when looking for types Signed-off-by: GitHub --- src/parser/cxx/name_lookup.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parser/cxx/name_lookup.cc b/src/parser/cxx/name_lookup.cc index a5eb79a2..93b38624 100644 --- a/src/parser/cxx/name_lookup.cc +++ b/src/parser/cxx/name_lookup.cc @@ -252,6 +252,11 @@ auto Lookup::lookupTypeHelper(Scope* scope, const Identifier* id, } for (auto candidate : scope->find(id)) { + if (auto u = symbol_cast(candidate); + u && u->target()) { + candidate = u->target(); + } + if (is_type(candidate) || candidate->isNamespace()) { return candidate; }