Jonathan Wakely | 9 Jul 2012 13:26
Picon

G++ namespace association extension

http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html says:

"Caution: The semantics of this extension are not fully defined. Users
should refrain from using this extension as its semantics may change
subtly over time. It is possible that this extension will be removed
in future versions of G++. "

Is it safe to assume that the semantics are now fixed to match those
of C++11 inline namespaces and will not change unless removed?

If so I'll prepare a patch for the manual.

Jason Merrill | 9 Jul 2012 15:18
Picon
Favicon

Re: G++ namespace association extension

On 07/09/2012 01:26 PM, Jonathan Wakely wrote:
> http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html says:
>
> "Caution: The semantics of this extension are not fully defined. Users
> should refrain from using this extension as its semantics may change
> subtly over time. It is possible that this extension will be removed
> in future versions of G++. "
>
> Is it safe to assume that the semantics are now fixed to match those
> of C++11 inline namespaces and will not change unless removed?

Yes, but people should use inline namespaces instead; we should 
deprecate this form and then remove it in 4.9.

Jason

Jonathan Wakely | 10 Jul 2012 23:34
Picon

Re: G++ namespace association extension

On 9 July 2012 14:18, Jason Merrill wrote:
> On 07/09/2012 01:26 PM, Jonathan Wakely wrote:
>>
>> http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html says:
>>
>> "Caution: The semantics of this extension are not fully defined. Users
>> should refrain from using this extension as its semantics may change
>> subtly over time. It is possible that this extension will be removed
>> in future versions of G++. "
>>
>> Is it safe to assume that the semantics are now fixed to match those
>> of C++11 inline namespaces and will not change unless removed?
>
>
> Yes, but people should use inline namespaces instead; we should deprecate
> this form and then remove it in 4.9.

        * doc/extend.texi (Namespace Association): Alter cautionary text.

How's this, OK for trunk?
commit d6a414f6ebcd96645a1a6612e324eafee24b39e9
Author: Jonathan Wakely <jwakely.gcc <at> gmail.com>
Date:   Tue Jul 10 21:21:09 2012 +0100

    	* doc/extend.texi (Namespace Association): Alter cautionary text.

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 91e7385..c3faf09 100644
(Continue reading)

Jason Merrill | 11 Jul 2012 01:25
Picon
Favicon

Re: G++ namespace association extension

OK.

Jason

Gerald Pfeifer | 15 Jul 2012 13:26

Re: G++ namespace association extension

On Tue, 10 Jul 2012, Jonathan Wakely wrote:
>> Yes, but people should use inline namespaces instead; we should deprecate
>> this form and then remove it in 4.9.
> 
>         * doc/extend.texi (Namespace Association): Alter cautionary text.

I think this also should go into the GCC 4.8 release notes
(gcc-4.8/changes.html)?

Gerald

Jonathan Wakely | 15 Jul 2012 17:10
Picon

Re: G++ namespace association extension

On 15 July 2012 12:26, Gerald Pfeifer wrote:
> On Tue, 10 Jul 2012, Jonathan Wakely wrote:
>>> Yes, but people should use inline namespaces instead; we should deprecate
>>> this form and then remove it in 4.9.
>>
>>         * doc/extend.texi (Namespace Association): Alter cautionary text.
>
> I think this also should go into the GCC 4.8 release notes
> (gcc-4.8/changes.html)?

I can do that too.  There's no gcc-4.8 dir yet, do I need to copy over
the various other files from the gcc-4.7 dir or can I just create
changes.html and leave the RM to do the rest at the appropriate time?

Gerald Pfeifer | 16 Jul 2012 01:34

Re: G++ namespace association extension

On Sun, 15 Jul 2012, Jonathan Wakely wrote:
>> I think this also should go into the GCC 4.8 release notes
>> (gcc-4.8/changes.html)?
> I can do that too.  There's no gcc-4.8 dir yet, do I need to copy over
> the various other files from the gcc-4.7 dir or can I just create
> changes.html and leave the RM to do the rest at the appropriate time?

If you run `cvs up -PAd` it should magically appear. :-)

Gerald

Jonathan Wakely | 17 Jul 2012 21:48
Picon

Re: G++ namespace association extension

On 16 July 2012 00:34, Gerald Pfeifer wrote:
> On Sun, 15 Jul 2012, Jonathan Wakely wrote:
>>> I think this also should go into the GCC 4.8 release notes
>>> (gcc-4.8/changes.html)?
>> I can do that too.  There's no gcc-4.8 dir yet, do I need to copy over
>> the various other files from the gcc-4.7 dir or can I just create
>> changes.html and leave the RM to do the rest at the appropriate time?
>
> If you run `cvs up -PAd` it should magically appear. :-)

Ah yes, I'd (quite happily) forgotten how to use CVS, but have now
reinstated the ~/.cvsrc I used to have on my previous machine.

Here's what I committed.
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.5
diff -u -r1.5 changes.html
--- changes.html	15 Jul 2012 21:24:31 -0000	1.5
+++ changes.html	17 Jul 2012 19:46:32 -0000
 <at>  <at>  -21,6 +21,9  <at>  <at> 
 directory.  The installation manual contains
 more information about requirements to build GCC.</p>

+<p>The G++ namespace association extension, <code>__attribute ((strong))</code>,
+has been deprecated. Inline namespaces should be used instead.</p>
+
(Continue reading)

Jason Merrill | 16 Jul 2012 17:46
Picon
Favicon

Re: G++ namespace association extension

On 07/15/2012 07:26 AM, Gerald Pfeifer wrote:
> I think this also should go into the GCC 4.8 release notes
> (gcc-4.8/changes.html)?

I doubt that it has gotten wide enough usage to need that, but I suppose 
it doesn't hurt.

Jason


Gmane