This actually looks like a duplicate of PR80682, but that one was closed as "fixed" a while back, and the bug is still present. // https://godbolt.org/g/SfcQiC #include <type_traits> int x[] = { std::is_trivially_constructible_v<int,void*>, std::is_constructible_v<int,void*>, }; int main() { printf("%d %d\n", x[0], x[1]); } On Clang this prints "0 0" because `int` is not constructible from `void*`. On GCC this prints "1 0": `int` is trivially constructible, yet not constructible, from `void*`.
Presumably started with r248153
(In reply to Arthur O'Dwyer from comment #0) > This actually looks like a duplicate of PR80682, but that one was closed as > "fixed" a while back, and the bug is still present. Definitely not a dup. The testcase for PR 80682 no longer fails, and the testcase for this one didn't fail until the fix for 80682 was committed. So it's caused by it, and so can't possibly be a dup.
Author: redi Date: Wed Jul 4 09:03:18 2018 New Revision: 262379 URL: https://gcc.gnu.org/viewcvs?rev=262379&root=gcc&view=rev Log: PR libstdc++/86398 fix std::is_trivially_constructible regression The intrinsic doesn't check for allowed conversions between scalar types, so restore the std::is_constructible check. Also make some trivial whitespace changes. PR libstdc++/86398 * include/std/type_traits (is_trivially_constructible): Check is_constructible before __is_trivially_constructible. * testsuite/20_util/is_trivially_constructible/value.cc: Add more tests, including negative cases. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Use zero for dg-error lineno. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/std/type_traits trunk/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc trunk/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc trunk/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
Author: redi Date: Wed Jul 4 11:44:11 2018 New Revision: 262381 URL: https://gcc.gnu.org/viewcvs?rev=262381&root=gcc&view=rev Log: PR libstdc++/86398 fix std::is_trivially_constructible regression The intrinsic doesn't check for allowed conversions between scalar types, so restore the std::is_constructible check. Also make some trivial whitespace changes. PR libstdc++/86398 * include/std/type_traits (is_trivially_constructible): Check is_constructible before __is_trivially_constructible. * testsuite/20_util/is_trivially_constructible/value.cc: Add more tests, including negative cases. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Use zero for dg-error lineno. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. Modified: branches/gcc-8-branch/libstdc++-v3/ChangeLog branches/gcc-8-branch/libstdc++-v3/include/std/type_traits branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
The regression is fixed for 8.2 with a workaround in the library header. Changing component back to c++ so Ville can fix the intrinisic.
Author: ville Date: Wed Jul 4 19:21:38 2018 New Revision: 262420 URL: https://gcc.gnu.org/viewcvs?rev=262420&root=gcc&view=rev Log: PR c++/86398 gcc/cp/ PR c++/86398 * method.c (is_trivially_xible): Return false if is_xible_helper returns a NULL_TREE. testsuite/ PR c++/86398 * g++.dg/ext/is_trivially_constructible1.C: Add new tests. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/method.c trunk/gcc/testsuite/g++.dg/ext/is_trivially_constructible1.C
Author: ville Date: Wed Jul 4 20:56:12 2018 New Revision: 262424 URL: https://gcc.gnu.org/viewcvs?rev=262424&root=gcc&view=rev Log: Backport from mainline 2018-07-04 Ville Voutilainen <ville.voutilainen@gmail.com> gcc/cp/ PR c++/86398 * method.c (is_trivially_xible): Return false if is_xible_helper returns a NULL_TREE. testsuite/ PR c++/86398 * g++.dg/ext/is_trivially_constructible1.C: Add new tests. Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/method.c branches/gcc-8-branch/gcc/testsuite/g++.dg/ext/is_trivially_constructible1.C
Fixed.