Message ID | CADzB+2k8Hf+B2iCM0z7nsiYYbQAOD31ahF+iUAegSP4HKPBdZQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | C++ PATCH for c++/81589, error with is_trivially_constructible | expand |
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 59ad43f73fe..a2d4c071efa 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1165,6 +1165,7 @@ constructible_expr (tree to, tree from) { tree ctype = to; vec<tree, va_gc> *args = NULL; + cp_unevaluated cp_uneval_guard; if (TREE_CODE (to) != REFERENCE_TYPE) to = cp_build_reference_type (to, /*rval*/false); tree ob = build_stub_object (to); diff --git a/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C new file mode 100644 index 00000000000..10a8dfbb8f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C @@ -0,0 +1,10 @@ +// PR c++/81589 + +template <typename k> +struct z { + z() { + k::error; + } +}; + +int x = __is_trivially_constructible(z<int>);