aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/except.cc')
-rw-r--r--gcc/cp/except.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc
index a7f35e4..204769f 100644
--- a/gcc/cp/except.cc
+++ b/gcc/cp/except.cc
@@ -1218,6 +1218,20 @@ expr_noexcept_p (tree expr, tsubst_flags_t complain)
return true;
}
+/* If EXPR is not noexcept, explain why. */
+
+void
+explain_not_noexcept (tree expr)
+{
+ tree fn = cp_walk_tree_without_duplicates (&expr, check_noexcept_r, 0);
+ 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));
+}
+
/* Return true iff SPEC is throw() or noexcept(true). */
bool