This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Added noexcept on constructors


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]