aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.cc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
commit071b4126c613881f4cb25b4e5c39032964827f88 (patch)
tree7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/cp/except.cc
parent845d23f3ea08ba873197c275a8857eee7edad996 (diff)
parentcaa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff)
downloadgcc-devel/gfortran-test.zip
gcc-devel/gfortran-test.tar.gz
gcc-devel/gfortran-test.tar.bz2
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/cp/except.cc')
-rw-r--r--gcc/cp/except.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc
index 2c1ef4c..204769f 100644
--- a/gcc/cp/except.cc
+++ b/gcc/cp/except.cc
@@ -1218,13 +1218,15 @@ expr_noexcept_p (tree expr, tsubst_flags_t complain)
return true;
}
-/* Explain why EXPR is not noexcept. */
+/* If EXPR is not noexcept, explain why. */
-void explain_not_noexcept (tree expr)
+void
+explain_not_noexcept (tree expr)
{
tree fn = cp_walk_tree_without_duplicates (&expr, check_noexcept_r, 0);
- gcc_assert (fn);
- if (DECL_P (fn))
+ if (!fn)
+ /* The call was noexcept, nothing to do. */;
+ else if (DECL_P (fn))
inform (DECL_SOURCE_LOCATION (fn), "%qD is not %<noexcept%>", fn);
else
inform (location_of (fn), "%qT is not %<noexcept%>", TREE_TYPE (fn));