]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Add detailed diagnostics for __builtin_has_unique_object_representations
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 23 Oct 2025 02:51:57 +0000 (13:51 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 22 Nov 2025 23:45:12 +0000 (10:45 +1100)
commitf1e596c9526fbb4cf0bfa56b07d3c52aab9c9938
tree551dca61c0e07a8454585d5fb2bb74d92bad0813
parent49acd44ac36a36b659bcead4cec80dde04bbccee
c++: Add detailed diagnostics for __builtin_has_unique_object_representations

gcc/cp/ChangeLog:

* constraint.cc (diagnose_trait_expr)
<case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS>: Explain failure with
more detail.
* cp-tree.h (type_has_unique_obj_representations): Add explain
parameter.
* tree.cc (record_has_unique_obj_representations): Explain when
returning false.
(type_has_unique_obj_representations): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/has-unique-obj-representations5.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/constraint.cc
gcc/cp/cp-tree.h
gcc/cp/tree.cc
gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations5.C [new file with mode: 0644]