Commit b51da998 by Ville Voutilainen Committed by Ville Voutilainen

re PR c++/87093 (is_constructible (__is_constructible() instrinsic) explicitly…

re PR c++/87093 (is_constructible (__is_constructible() instrinsic) explicitly instantiates conversion member function of source)

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
parent 4911b24d
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
......
......@@ -1144,11 +1144,11 @@ static tree
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);
......
// { 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>);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment