This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/64651] New: std::rethrow_exception not found by ADL
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 17 Jan 2015 23:02:43 +0000
- Subject: [Bug libstdc++/64651] New: std::rethrow_exception not found by ADL
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64651
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