https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128888
Bug ID: 128888
Summary: Reflection of using of unscoped enumerator not
rejected
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
namespace N { enum E { E0 }; using E::E0; static constexpr auto a = ^^N::E0; }
should be rejected but we silently accept it.
Works fine for enum class E instead.
For the unscoped enums, seems we do create some USING_DECL, and have
CONST_DECL_USING_P macro so supposedly also create CONST_DECL with DECL_CONTEXT
of N, but during name lookup either don't have it remembered or see through it.
strip_using_decl sees CONST_DECL which is not CONST_DECL_USING_P...