]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: mem-initializer-id qualified name lookup is type-only [PR122192]
authorPatrick Palka <ppalka@redhat.com>
Tue, 14 Oct 2025 16:56:23 +0000 (12:56 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 14 Oct 2025 16:56:23 +0000 (12:56 -0400)
commit97da8fece19caf0277c2be523520d09252821973
treef3c877dcbe69e32455558960183fe0a51f59a3a2
parent6e9ab669b584496dd628700d0d69bd20c5c12ca7
c++: mem-initializer-id qualified name lookup is type-only [PR122192]

Since a mem-initializer needs to be able to initialize any base class,
lookup for which is type-only, we in turn need to make mem-initializer-id
qualified name lookup type-only too.

PR c++/122192

gcc/cp/ChangeLog:

* parser.cc (cp_parser_mem_initializer_id): Pass class_type
instead of typename_type to cp_parser_class_name in the
nested-name-specifier case.

gcc/testsuite/ChangeLog:

* g++.dg/template/dependent-base6.C: Verify mem-initializer-id
qualified name lookup is type-only too.

Reported-by: Vincent X
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/parser.cc
gcc/testsuite/g++.dg/template/dependent-base6.C