diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-07-29 22:20:32 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-07-31 07:55:32 +1000 |
commit | bfb8615031a8c23df814d011567735093e3c1ac6 (patch) | |
tree | dc80d86d3c4de2202e94c7a0cb23fceeb329e3a4 /gcc/rust/parse/rust-parse-impl.h | |
parent | ec7244e6e09654a2e720d60ceb0f24c6d66c44f7 (diff) | |
download | gcc-bfb8615031a8c23df814d011567735093e3c1ac6.zip gcc-bfb8615031a8c23df814d011567735093e3c1ac6.tar.gz gcc-bfb8615031a8c23df814d011567735093e3c1ac6.tar.bz2 |
c++: Don't assume trait funcs return error_mark_node when tf_error is passed [PR121291]
For the sake of determining if there are other errors in user code to
report early, many trait functions don't always return error_mark_node
if not called in a SFINAE context (i.e., tf_error is set). This patch
removes some assumptions on this behaviour I'd made when improving
diagnostics of builtin traits.
PR c++/121291
gcc/cp/ChangeLog:
* constraint.cc (diagnose_trait_expr): Remove assumption about
failures returning error_mark_node.
* except.cc (explain_not_noexcept): Allow expr not being
noexcept.
* method.cc (build_invoke): Adjust comment.
(is_trivially_xible): Always note non-trivial components if expr
is not null or error_mark_node.
(is_nothrow_xible): Likewise for non-noexcept components.
(is_nothrow_convertible): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/ext/is_invocable7.C: New test.
* g++.dg/ext/is_nothrow_convertible5.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
0 files changed, 0 insertions, 0 deletions