diff mbox series

[C++,wwwdocs] bugs/index.html - complete C++ non-bug entry

Message ID alpine.LSU.2.21.1809021531510.6216@anthias.pfeifer.com
State New
Headers show
Series [C++,wwwdocs] bugs/index.html - complete C++ non-bug entry | expand

Commit Message

Gerald Pfeifer Sept. 2, 2018, 2:26 p.m. UTC
Jason and Nathan,

while I completed one C+ non-bug entry with the patch below, I am
not sure the items as such is really still relevant?

In fact, if you could have a look at https://gcc.gnu.org/bugs/#nonbugs_cxx
and advise which entries perhaps should be removed (or updated or
added), I'll take care.

Thanks,
Gerald

 
Add a missing <dt> element to the C++ Non-bugs section.

Comments

Nathan Sidwell Sept. 12, 2018, 10:25 a.m. UTC | #1
On 9/2/18 10:26 AM, Gerald Pfeifer wrote:
> Jason and Nathan,
> 
> while I completed one C+ non-bug entry with the patch below, I am
> not sure the items as such is really still relevant?
> 
> In fact, if you could have a look at https://gcc.gnu.org/bugs/#nonbugs_cxx
> and advise which entries perhaps should be removed (or updated or
> added), I'll take care.

sorry for the tardiness.

1) export
exported templates were removed as a feature in C++11.  'export' remains 
a reserved keyword.  It is being recycled for C++ modules, currently an 
experimental TS.

2) G++ emits two copies of constructors and destructors.
IIUC the ABI has been corrected to allow a single cdtor in cases where 
they are the same.  We emit compatibility(?) aliases on targets that 
support them.  Jason?

3) Global destructors are not run in the correct order.
I think --use-cxa-atexit is enabled by default on most (nearly all) 
targets these days.

4) Classes in exception specifiers must be complete types.
While this is still correct, exception specifiers were deprecated in 
C++11.  They were removed in C++17.  We still support them for 
compatibility.  Modern code should use noexcept, or 
noexcept(boolean-constant-expression)

5) Exceptions don't work in multithreaded applications.
Correct, but as with cxa-atexit, usually enabled by default on threading 
systems

6) Templates, scoping, and digraphs.
again, correct, but we give a very clueful diagnostic:
digraph.cc:8:2: error: ‘<::’ cannot begin a template-argument list 
[-fpermissive]
  B<::X::A> *p;
   ^~
digraph.cc:8:2: note: ‘<:’ is an alternate spelling for ‘[’. Insert 
whitespace between ‘<’ and ‘::’
digraph.cc:8:2: note: (if you use ‘-fpermissive’ or ‘-std=c++11’, or 
‘-std=gnu++11’ G++ will accept your code)

7) Copy constructor access check while initializing a reference.
This example is no longer correct, it compiles without error (including 
c++98 mode).  I think compilers now have to know about about-to-die 
temporaries and move them?

8) ABI changes
We should probably document the std-forced ABI changes?

Hope that helps.

nathan
Jason Merrill Sept. 12, 2018, 7:47 p.m. UTC | #2
On Wed, Sep 12, 2018 at 6:25 AM, Nathan Sidwell <nathan@acm.org> wrote:
> On 9/2/18 10:26 AM, Gerald Pfeifer wrote:
>>
>> Jason and Nathan,
>>
>> while I completed one C+ non-bug entry with the patch below, I am
>> not sure the items as such is really still relevant?
>>
>> In fact, if you could have a look at https://gcc.gnu.org/bugs/#nonbugs_cxx
>> and advise which entries perhaps should be removed (or updated or
>> added), I'll take care.
>
>
> sorry for the tardiness.
>
> 1) export
> exported templates were removed as a feature in C++11.  'export' remains a
> reserved keyword.  It is being recycled for C++ modules, currently an
> experimental TS.

Yes, the heading should say "C++98 export".

> 2) G++ emits two copies of constructors and destructors.
> IIUC the ABI has been corrected to allow a single cdtor in cases where they
> are the same.  We emit compatibility(?) aliases on targets that support
> them.  Jason?

The ABI hasn't changed, we just do better about avoiding code
duplication.  Nowadays we mostly only emit two separate complete
functions for variadic constructors in a class with virtual bases.
So, rarely.  But there are still two symbols for the different entry
points.

> 3) Global destructors are not run in the correct order.
> I think --use-cxa-atexit is enabled by default on most (nearly all) targets
> these days.

We certainly try to enable it everywhere __cxa_atexit is available,
which is indeed pretty common at this point.

> 4) Classes in exception specifiers must be complete types.
> While this is still correct, exception specifiers were deprecated in C++11.
> They were removed in C++17.  We still support them for compatibility.
> Modern code should use noexcept, or noexcept(boolean-constant-expression)

Yeah, this isn't interesting anymore.

> 5) Exceptions don't work in multithreaded applications.
> Correct, but as with cxa-atexit, usually enabled by default on threading
> systems
>
> 6) Templates, scoping, and digraphs.
> again, correct, but we give a very clueful diagnostic:
> digraph.cc:8:2: error: ‘<::’ cannot begin a template-argument list
> [-fpermissive]
>  B<::X::A> *p;
>   ^~
> digraph.cc:8:2: note: ‘<:’ is an alternate spelling for ‘[’. Insert
> whitespace between ‘<’ and ‘::’
> digraph.cc:8:2: note: (if you use ‘-fpermissive’ or ‘-std=c++11’, or
> ‘-std=gnu++11’ G++ will accept your code)
>
> 7) Copy constructor access check while initializing a reference.
> This example is no longer correct, it compiles without error (including
> c++98 mode).  I think compilers now have to know about about-to-die
> temporaries and move them?

As the document says, we allow this as of GCC 4.3.  At this point it
isn't useful to keep this entry around.

> 8) ABI changes
> We should probably document the std-forced ABI changes?

The text that says we change the ABI with each major version is no
longer accurate since we moved to bumping the major version every
year.  This should definitely be updated.

Jason
diff mbox series

Patch

Index: bugs/index.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/bugs/index.html,v
retrieving revision 1.126
diff -u -r1.126 index.html
--- bugs/index.html	1 Sep 2018 23:42:01 -0000	1.126
+++ bugs/index.html	2 Sep 2018 13:30:52 -0000
@@ -538,6 +538,7 @@ 
 <h2 id="nonbugs_cxx">C++</h2>
 
 <dl>
+<dt><code>export</code></dt>
 <dd><p>Most C++ compilers (G++ included) do not yet implement
 <code>export</code>, which is necessary for separate compilation of
 template declarations and definitions. Without <code>export</code>, a