[Bug c++/86398] New: is_trivially_constructible always returns true even when is_constructible returns false
arthur.j.odwyer at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 4 01:26:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86398
Bug ID: 86398
Summary: is_trivially_constructible always returns true even
when is_constructible returns false
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: arthur.j.odwyer at gmail dot com
Target Milestone: ---
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*`.
More information about the Gcc-bugs
mailing list