aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/lib/java
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-08-31 17:01:22 -0400
committerJason Merrill <jason@redhat.com>2025-04-16 22:25:45 -0400
commitac31e41c584c59f8f2e381d545235a32b7c9e406 (patch)
tree64aeae34a8f3b6af9638f555840fab64d24017db /libjava/classpath/lib/java
parent5e3646a3cb7a03a368367b7c252b4985c7931f4a (diff)
downloadgcc-ac31e41c584c59f8f2e381d545235a32b7c9e406.zip
gcc-ac31e41c584c59f8f2e381d545235a32b7c9e406.tar.gz
gcc-ac31e41c584c59f8f2e381d545235a32b7c9e406.tar.bz2
c++: ill-formed constexpr function [PR113360]
If we already gave an error while parsing a function, we don't also need to try to explain what's wrong with it when we later try to use it in a constant-expression. In the new testcase explain_invalid_constexpr_fn couldn't find anything still in the function to complain about, so it said because: followed by nothing. We still try to constant-evaluate it to reduce error cascades, but we shouldn't complain if it doesn't work very well. This flag is similar to CLASSTYPE_ERRONEOUS that I added a while back. PR c++/113360 gcc/cp/ChangeLog: * cp-tree.h (struct language_function): Add erroneous bit. * constexpr.cc (explain_invalid_constexpr_fn): Return if set. (cxx_eval_call_expression): Quiet if set. * parser.cc (cp_parser_function_definition_after_declarator) * pt.cc (instantiate_body): Set it. gcc/testsuite/ChangeLog: * g++.dg/cpp23/constexpr-nonlit18.C: Remove redundant message. * g++.dg/cpp1y/constexpr-diag2.C: New test. * g++.dg/cpp1y/pr63996.C: Adjust expected errors. * g++.dg/template/explicit-args6.C: Likewise. * g++.dg/cpp0x/constexpr-ice21.C: Likewise.
Diffstat (limited to 'libjava/classpath/lib/java')
0 files changed, 0 insertions, 0 deletions