public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
@ 2013-12-16 13:36 bootsarehax at gmail dot com
  2014-02-09 15:11 ` [Bug c++/59526] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bootsarehax at gmail dot com @ 2013-12-16 13:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

            Bug ID: 59526
           Summary: [C++11] Defaulted special member functions don't
                    accept noexcept if a member has a non-trivial noexcept
                    operator in the corresponding special member function
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bootsarehax at gmail dot com

The following code fails for struct X on gcc 4.8.2 with:

bla.cpp:15:3: error: function ‘X::X()’ defaulted on its first declaration with
an exception-specification that differs from the implicit declaration ‘X::X()’
   X() noexcept = default;

bla.cpp:16:6: error: function ‘X& X::operator=(X&&)’ defaulted on its first
declaration with an exception-specification that differs from the implicit
declaration ‘X& X::operator=(X&&)’
   X& operator=(X&&) noexcept = default;

#include <type_traits>

template<bool b>
struct F {
  F() noexcept(b) {}
  F& operator=(F&&) noexcept(b) {return *this;}
};

struct Simple {
  Simple() noexcept {}
  Simple& operator=(Simple&&) noexcept {return *this;}
};

struct X {
  X() noexcept = default;
  X& operator=(X&&) noexcept = default;
  F<true> f;
};
struct X2 {
  X2() /* noexcept */ = default;
  X2& operator=(X2&&) /* noexcept */ = default;
  F<true> f;
};
struct X3 {
  X3() noexcept = default;
  X3& operator=(X3&&) noexcept = default;
  Simple f;
};

static_assert(std::is_nothrow_constructible<X>::value, "");
static_assert(std::is_nothrow_move_assignable<X>::value, "");
static_assert(std::is_nothrow_constructible<X2>::value, "");
static_assert(std::is_nothrow_move_assignable<X2>::value, "");
static_assert(std::is_nothrow_constructible<X3>::value, "");
static_assert(std::is_nothrow_move_assignable<X3>::value, "");

X2 shows that a noexcept function is implicitly generated. X3 shows that it is
necessary for the noexcept operator to depend on a template parameter to
trigger this behavior.
>From gcc-bugs-return-437723-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 16 13:37:34 2013
Return-Path: <gcc-bugs-return-437723-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18752 invoked by alias); 16 Dec 2013 13:37:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18728 invoked by uid 48); 16 Dec 2013 13:37:31 -0000
From: "ktietz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/56645] libgcc /configure identifies non-existing /lib/cpp as preprocessor on Mingw
Date: Mon, 16 Dec 2013 13:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ktietz at gcc dot gnu.org
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-56645-4-HMCfPj1Iru@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56645-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56645-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg01378.txt.bz2
Content-length: 850

http://gcc.gnu.org/bugzilla/show_bug.cgi?idV645

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #2 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Hmm, by this report I can't make much out of it.  To see the failure reported
in config.log for this test might be helpful.  I can't reproduce the issue by
building mingw-w64 based toolchain, so it seems to be something specific to
MinGW.org setup...

AFAICS might be the cause for this issue the lack of installed headers/runtime.
As you were using as prefix /mingw/local/, are you sure crt and headers are
installed in /mingw/local/mingw32/include and /mingw/local/mingw32/lib?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
  2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
@ 2014-02-09 15:11 ` redi at gcc dot gnu.org
  2014-02-09 15:22 ` daniel.kruegler at googlemail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-09 15:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-09
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Trunk doesn't give the same errors, but fails two of the assertions:

n.cc:30:1: error: static assertion failed: 
 static_assert(std::is_nothrow_constructible<X>::value, "");
 ^
n.cc:31:1: error: static assertion failed: 
 static_assert(std::is_nothrow_move_assignable<X>::value, "");
 ^


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
  2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
  2014-02-09 15:11 ` [Bug c++/59526] " redi at gcc dot gnu.org
@ 2014-02-09 15:22 ` daniel.kruegler at googlemail dot com
  2015-03-19 10:37 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-02-09 15:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> Trunk doesn't give the same errors, but fails two of the assertions:
> 
> n.cc:30:1: error: static assertion failed: 
>  static_assert(std::is_nothrow_constructible<X>::value, "");

The reason seems to be that the compiler makes this a deleted function, arguing 

"'X::X() noexcept' is implicitly deleted because its exception-specification
does not match the implicit exception-specification 'noexcept
(<uninstantiated>)' X() noexcept = default;"

This looks incorrect to me.
>From gcc-bugs-return-443128-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Feb 09 16:24:21 2014
Return-Path: <gcc-bugs-return-443128-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5270 invoked by alias); 9 Feb 2014 16:24:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5238 invoked by uid 48); 9 Feb 2014 16:24:15 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59395] [4.8 Regression] double free with procedure pointer component
Date: Sun, 09 Feb 2014 16:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: janus at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59395-4-CdJqE2fmFI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59395-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59395-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg00885.txt.bz2
Content-length: 148

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY395

--- Comment #5 from janus at gcc dot gnu.org ---
Pretty much a duplicate of PR 58803 after all.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
  2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
  2014-02-09 15:11 ` [Bug c++/59526] " redi at gcc dot gnu.org
  2014-02-09 15:22 ` daniel.kruegler at googlemail dot com
@ 2015-03-19 10:37 ` paolo.carlini at oracle dot com
  2023-09-13 20:47 ` cvs-commit at gcc dot gnu.org
  2023-09-27 16:17 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-19 10:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is fixed for 5.0.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
  2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
                   ` (2 preceding siblings ...)
  2015-03-19 10:37 ` paolo.carlini at oracle dot com
@ 2023-09-13 20:47 ` cvs-commit at gcc dot gnu.org
  2023-09-27 16:17 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-13 20:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Francois Dumont <fdumont@gcc.gnu.org>:

https://gcc.gnu.org/g:92456291849fe88303bbcab366f41dcd4a885ad5

commit r14-3926-g92456291849fe88303bbcab366f41dcd4a885ad5
Author: François Dumont <fdumont@gcc.gnu.org>
Date:   Wed Aug 23 19:15:43 2023 +0200

    libstdc++: [_GLIBCXX_INLINE_VERSION] Fix <format> friend declaration

    GCC do not consider the inline namespace in friend function declarations.
    This is PR c++/59526, we need to explicit this namespace.

    libstdc++-v3/ChangeLog:

            * include/std/format (std::__format::_Arg_store): Explicit version
            namespace on make_format_args friend declaration.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59526] [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function
  2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
                   ` (3 preceding siblings ...)
  2023-09-13 20:47 ` cvs-commit at gcc dot gnu.org
@ 2023-09-27 16:17 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-27 16:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59526

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0547f663ee09aa5887dcd1bb0ea48eba24a30485

commit r13-7917-g0547f663ee09aa5887dcd1bb0ea48eba24a30485
Author: François Dumont <fdumont@gcc.gnu.org>
Date:   Wed Aug 23 19:15:43 2023 +0200

    libstdc++: [_GLIBCXX_INLINE_VERSION] Fix <format> friend declaration

    GCC do not consider the inline namespace in friend function declarations.
    This is PR c++/59526, we need to explicit this namespace.

    libstdc++-v3/ChangeLog:

            * include/std/format (std::__format::_Arg_store): Explicit version
            namespace on make_format_args friend declaration.

    (cherry picked from commit 92456291849fe88303bbcab366f41dcd4a885ad5)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-27 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 13:36 [Bug c++/59526] New: [C++11] Defaulted special member functions don't accept noexcept if a member has a non-trivial noexcept operator in the corresponding special member function bootsarehax at gmail dot com
2014-02-09 15:11 ` [Bug c++/59526] " redi at gcc dot gnu.org
2014-02-09 15:22 ` daniel.kruegler at googlemail dot com
2015-03-19 10:37 ` paolo.carlini at oracle dot com
2023-09-13 20:47 ` cvs-commit at gcc dot gnu.org
2023-09-27 16:17 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).