[PATCH v2 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

Jason Merrill jason@redhat.com
Tue Jul 9 21:43:59 GMT 2024


On 7/9/24 9:44 AM, Nathaniel Shead wrote:
> On Mon, Jul 08, 2024 at 12:26:41PM -0400, Jason Merrill wrote:
>> For a using-decl in the same scope as the original decl, won't this replace
>> it so only the using-decl is visible to lookup?  I had expected to omit the
>> USING_DECL in that case.
> 
> Yup it will; I think I'd originally done that so that more recent
> (re-)declaration would be the one referred to by diagnostics, but on
> retrospect that seems unhelpful; fixed.  (Though need to keep the
> replacement for CONST_DECLs, because the modules handling otherwise only
> handles them in the context of their containing enumeration type, which
> isn't what we want here; I've added a new test for this as well.)

Ah, using-25, sure.  I would think we could still tell the difference by 
comparing PURVIEW/EXPORT on the CONST_DECL to those of its type?

Or perhaps have add_binding_entity skip implicitly inserted enumerators, 
and instead insert them again when reading the enum, which should also 
save a bit of space.

Jason



More information about the Gcc-patches mailing list