PR c++/87093
gcc/cp
PR c++/87093
* method.c (constructible_expr): We're in an unevaluated context
in all cases, not just for class targets.
testsuite/
PR c++/87093
* g++.dg/ext/is_constructible2.C: New.
From-SVN: r264253
+2018-09-13 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR c++/87093
+ * method.c (constructible_expr): We're in an unevaluated context
+ in all cases, not just for class targets.
+
2018-09-12 David Malcolm <dmalcolm@redhat.com>
PR c++/85110
constructible_expr (tree to, tree from)
{
tree expr;
+ cp_unevaluated cp_uneval_guard;
if (CLASS_TYPE_P (to))
{
tree ctype = to;
vec<tree, va_gc> *args = NULL;
- cp_unevaluated cp_uneval_guard;
if (!TYPE_REF_P (to))
to = cp_build_reference_type (to, /*rval*/false);
tree ob = build_stub_object (to);
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+#include <type_traits>
+
+template <typename T> struct x {
+ operator bool() {
+ static_assert(!std::is_same<T, T>::value, "");
+ return false;
+ }
+};
+
+static constexpr auto a = __is_constructible(bool, x<int>);