https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114804

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <[email protected]>:

https://gcc.gnu.org/g:6d3cc093428e42e0b04f53040f43f9ca1c6f9acb

commit r17-3861-g6d3cc093428e42e0b04f53040f43f9ca1c6f9acb
Author: Lunex <[email protected]>
Date:   Tue Sep 1 13:34:05 2026 +0600

    c++: lookup in enclosing scope when instantiating nested class bases

    r11-6815 (PR 82613) removed push_scope/pop_scope around base-clause
    substitution in instantiate_class_template. This broke lookup for
    using-declarations that bring enclosing-class members into scope
    during nested class instantiation.

    So let's restore the push_scope.  But rather than pop_scope after the bases
    and then immediately push_nested_class, we can move the pop_scope to the
end
    of the function and just pushclass/popclass for the class itself.

            PR c++/114804

    gcc/cp/ChangeLog:
            * pt.cc (instantiate_class_template): Push enclosing scope
            before base substitution, pop at the end.

    gcc/testsuite/ChangeLog:
            * g++.dg/template/dependent-base7.C: New test.

    Co-authored-by: Jason Merrill <[email protected]>

Reply via email to