[v3] PR libstdc++/68430

Message ID CAFk2RUa8jX4ToMNiRu4aYHLnNscGAci8BH2O8EJqh9AvnvSZrw@mail.gmail.com
State New
Headers show
Series
  • [v3] PR libstdc++/68430
Related show

Commit Message

Ville Voutilainen Dec. 16, 2017, 12:30 p.m.
The compiler-powered is_constructible that we have in gcc 8 is powerful
enough to give the right answer to an is_constructible question
that would be hard for a pure-library implementation to get right
in a well-formed fashion. This is just adding a test for it. Tested
on Linux-PPC64, OK for trunk?

2017-12-16  Ville Voutilainen  <ville.voutilainen@gmail.com>

    PR libstdc++/68430
    * testsuite/20_util/is_constructible/68430.cc: New.

Comments

Jonathan Wakely Dec. 18, 2017, 5:58 p.m. | #1
On 16 December 2017 at 12:30, Ville Voutilainen  wrote:
> The compiler-powered is_constructible that we have in gcc 8 is powerful

> enough to give the right answer to an is_constructible question

> that would be hard for a pure-library implementation to get right

> in a well-formed fashion. This is just adding a test for it. Tested

> on Linux-PPC64, OK for trunk?


OK, thanks.

Patch

diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc b/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc
new file mode 100644
index 0000000..3f880b3
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_constructible/68430.cc
@@ -0,0 +1,6 @@ 
+// { dg-do compile { target c++11 } }
+
+#include <type_traits>
+
+template<class T> struct Foo { Foo(T = nullptr) {} };
+static_assert(!std::is_constructible<Foo<int>>::value, "");