public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/64650] std::experimental::bad_optional_access is not default constructible
  2015-01-17 22:41 [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible redi at gcc dot gnu.org
@ 2015-01-17 22:41 ` redi at gcc dot gnu.org
  2015-01-20 11:51 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-17 22:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-17
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.0


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

* [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible
@ 2015-01-17 22:41 redi at gcc dot gnu.org
  2015-01-17 22:41 ` [Bug libstdc++/64650] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-17 22:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64650
           Summary: std::experimental::bad_optional_access is not default
                    constructible
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

This should compile using -std=c++14:

#include <experimental/optional>

std::experimental::bad_optional_access e;


badopt.cc:3:40: error: no matching function for call to
‘std::experimental::fundamentals_v1::bad_optional_access::bad_optional_access()’
 std::experimental::bad_optional_access e;
                                        ^
>From gcc-bugs-return-473684-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jan 17 23:02:52 2015
Return-Path: <gcc-bugs-return-473684-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5574 invoked by alias); 17 Jan 2015 23:02:51 -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 5540 invoked by uid 48); 17 Jan 2015 23:02:45 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/64651] New: std::rethrow_exception not found by ADL
Date: Sat, 17 Jan 2015 23:02:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-64651-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: 2015-01/txt/msg01678.txt.bz2
Content-length: 1164

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd651

            Bug ID: 64651
           Summary: std::rethrow_exception not found by ADL
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

This fails (using -std=c++11):

#include <exception>

int main()
{
  std::exception_ptr e;
  rethrow_exception(e);
}

The standard declares:

  typedef _unspecified_ exception_ptr;

  [[noreturn]] void rethrow_exception(exception_ptr p);

So it's conforming for exception_ptr to be a typedef for a type in a different
namespace, and in that case ADL won't find std::rethrow_exception, but it's not
very helpful to users for it to fail.

This makes it work as expected:

--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -68,6 +68,8 @@ namespace std

   namespace __exception_ptr
   {
+    using std::rethrow_exception;
+
     /**
      *  @brief An opaque pointer to an arbitrary exception.
      *  @ingroup exceptions


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

* [Bug libstdc++/64650] std::experimental::bad_optional_access is not default constructible
  2015-01-17 22:41 [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible redi at gcc dot gnu.org
  2015-01-17 22:41 ` [Bug libstdc++/64650] " redi at gcc dot gnu.org
@ 2015-01-20 11:51 ` redi at gcc dot gnu.org
  2015-06-10  9:43 ` redi at gcc dot gnu.org
  2015-06-10  9:44 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-20 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Jan 20 11:51:03 2015
New Revision: 219889

URL: https://gcc.gnu.org/viewcvs?rev=219889&root=gcc&view=rev
Log:
    PR libstdc++/64650
    * include/experimental/optional (bad_optional_access): Add default
    constructor.
    * testsuite/experimental/optional/requirements.cc: Test for default
    constructor.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/experimental/optional
    trunk/libstdc++-v3/testsuite/experimental/optional/requirements.cc


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

* [Bug libstdc++/64650] std::experimental::bad_optional_access is not default constructible
  2015-01-17 22:41 [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible redi at gcc dot gnu.org
  2015-01-17 22:41 ` [Bug libstdc++/64650] " redi at gcc dot gnu.org
  2015-01-20 11:51 ` redi at gcc dot gnu.org
@ 2015-06-10  9:43 ` redi at gcc dot gnu.org
  2015-06-10  9:44 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-06-10  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Wed Jun 10 09:42:37 2015
New Revision: 224323

URL: https://gcc.gnu.org/viewcvs?rev=224323&root=gcc&view=rev
Log:
Backport from mainline
2015-01-20  Jonathan Wakely  <jwakely@redhat.com>

        PR libstdc++/64650
        * include/experimental/optional (bad_optional_access): Add default
        constructor.
        * testsuite/experimental/optional/requirements.cc: Test for default
        constructor.

Modified:
    branches/gcc-4_9-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_9-branch/libstdc++-v3/include/experimental/optional
   
branches/gcc-4_9-branch/libstdc++-v3/testsuite/experimental/optional/requirements.cc


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

* [Bug libstdc++/64650] std::experimental::bad_optional_access is not default constructible
  2015-01-17 22:41 [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-06-10  9:43 ` redi at gcc dot gnu.org
@ 2015-06-10  9:44 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-06-10  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 4.9.3


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

end of thread, other threads:[~2015-06-10  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-17 22:41 [Bug libstdc++/64650] New: std::experimental::bad_optional_access is not default constructible redi at gcc dot gnu.org
2015-01-17 22:41 ` [Bug libstdc++/64650] " redi at gcc dot gnu.org
2015-01-20 11:51 ` redi at gcc dot gnu.org
2015-06-10  9:43 ` redi at gcc dot gnu.org
2015-06-10  9:44 ` redi 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).