This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strong using directives


On Thu, Mar 9, 2017 at 2:15 PM, Nathan Sidwell <nathan@acm.org> wrote:
> looking at how we implement inline namespaces on the back of strong using
> directives, I notice that strong using is much more general.  One can name a
> target namespace from multple different strong using directives in different
> namespaces.  (The DECL_NAMESPACE_ASSOCIATIONS is a list of the namespaces
> that strongly use this one.) Abuse of that could lead to horrible
> performance of ADL searching and the like. And simply restricting to inline
> namespace semantics of being an immediate child namespace would permit some
> simplifications and presumably speed ups of name-lookup (even with
> transitivity).
>
> The documentation though says that a strong using is equivalent to an inline
> namespace, and strong using will be removed in a future release:
>
>> {Caution:} The semantics of this extension are equivalent
>> to C++ 2011 inline namespaces.  Users should use inline namespaces
>> instead as this extension will be removed in future versions of G++.
>
> (added Jul 2012, which, in addition to noting inline namespace is now a
> thing, changed an existing 'may be removed' to 'will be removed')
>
> 1) the extra functionality of strong using seems pretty odd -- do you know
> of any uses of it?

No.  It was a first draft of what became inline namespaces.

> 2) what are your thoughts of actively deprecating strong using in gcc 7?
> I.e. emit a deprecation warning.

I think I already did:

2017-01-26  Jason Merrill  <jason@redhat.com>

        * name-lookup.c (parse_using_directive): Deprecate strong using.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]