This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: strong using directives
- From: Jason Merrill <jason at redhat dot com>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 9 Mar 2017 15:27:44 -0500
- Subject: Re: strong using directives
- Authentication-results: sourceware.org; auth=none
- References: <7d2f8dfb-87ff-c4bf-11ca-567facb08a98@acm.org>
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