This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] Added noexcept on constructors
- From: Aditya Kumar <aditya dot k7 at samsung dot com>
- To: 'Jonathan Wakely' <jwakely at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, ville dot voutilainen at gmail dot com
- Date: Tue, 06 Dec 2016 10:23:35 -0600
- Subject: RE: [PATCH] Added noexcept on constructors
- Authentication-results: sourceware.org; auth=none
- Cms-type: 301P
- References: <CAFk2RUZ=UTEWQfg3YdbG3bUMY_B3N2MOCCeXED_htLN1Q7-LPQ@mail.gmail.com> <1480973649-14879-1-git-send-email-aditya.k7@samsung.com> <CGME20161206102634epcas5p2b78ff4e5520a5897ec125a456a888164@epcas5p2.samsung.com> <20161206102629.GB6326@redhat.com>
Since g++ correctly finds this error, I'm wondering how
libstdc++-v3/src/c++11/shared_ptr.cc was compiling correctly before.
With a small test case:
$ cat tes.cpp
class A {
public:
A() noexcept;
};
A::A() {
}
$ ../../build/gcc/xg++ -B ../../build/gcc -c test.cpp -std=gnu++14
test.cpp:6:1: error: declaration of 'A::A()' has a different exception
specifier
A::A() {
^
test.cpp:3:3: note: from previous declaration 'A::A() noexcept'
A() noexcept;
Thanks,
-Aditya
-----Original Message-----
From: Jonathan Wakely [mailto:jwakely@redhat.com]
Sent: Tuesday, December 06, 2016 4:26 AM
To: Aditya Kumar
Cc: gcc-patches@gcc.gnu.org; libstdc++@gcc.gnu.org;
ville.voutilainen@gmail.com
Subject: Re: [PATCH] Added noexcept on constructors
On 05/12/16 15:34 -0600, Aditya Kumar wrote:
>Thanks for the feedback. Updated patch is below.
>
>
>The noexcept on definition and the declaration of constructors
>_Sp_locker do not match.
Thanks for the patch (and thanks, Ville, for reviewing it).
I'll commit this today.