From d05b13b604b8f9df088f8e6488e6f4b961697998 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 2 Aug 2026 15:30:20 -0700 Subject: [PATCH] Activate wildcard imports for class copy construction The source expression of a class copy constructor currently bypasses `pform_new_ident()`. An identifier made visible by a wildcard package import is therefore not activated and can not be resolved during elaboration. Create the source expression through `pform_new_ident()`, matching ordinary identifier expressions and preserving the source location. Signed-off-by: Lars-Peter Clausen --- parse.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/parse.y b/parse.y index 52ed19ad2..769c6d553 100644 --- a/parse.y +++ b/parse.y @@ -1426,9 +1426,8 @@ class_new /* IEEE1800-2005 A.2.4 */ $$ = new_expr; } | K_new hierarchy_identifier - { PEIdent*tmpi = new PEIdent(*$2, @2.lexical_pos); - FILE_NAME(tmpi, @2); - PENewCopy*tmp = new PENewCopy(tmpi); + { auto tmpi = pform_new_ident(@2, *$2); + auto tmp = new PENewCopy(tmpi); FILE_NAME(tmp, @1); delete $2; $$ = tmp;