This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++, wwwdocs] bugs/index.html - complete C++ non-bug entry
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