Repository navigation
C++23: using-declaration naming a member hidden in every direct base is still rejected (P1787R6) #512
the4amfriend
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
P1787R6 (adopted for C++23) removed the [namespace.udecl] requirement that the base class members named by a using-declaration "shall be visible in the scope of at least one of the direct base classes". EDG still applies the requirement in
--c++23and--c++26modes, so it rejects valid C++23 code.Under C++17 and C++20 the rejection matches the standard text. This report is only about C++23 and later modes.
Reproducing Source Code
Command-line Options
cpfe --c++23 --no_code_gen ui_twice.cc(also--c++23 --strict,--c++26)Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
Actual
Expected
Accepted, and the program returns 0 (
c.f(1.0)callsA::f(double)). GCC 15.3 and Clang 21.1 accept it in all modes,-pedantic-errorsincluded.Notes
check_member_using_visibility()insrc/class_decl.c, called only for indirect bases, and already skipped in cfront, g++/Clang and MSVC > 12.00 modes.cpp23_mode. The same approach fits here.Reproducing (Standard) Configuration(s)
linux-gcc-debug
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions