[PATCH] Added noexcept on constructors
Aditya Kumar
aditya.k7@samsung.com
Tue Dec 6 16:23:00 GMT 2016
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.
More information about the Libstdc++
mailing list