Commit 96176bb3 by Nathan Sidwell Committed by Nathan Sidwell

cp-tree.h: Clarify exception spec node comment.

	* cp-tree.h: Clarify exception spec node comment.
	* except.c (nothrow_spec_p): Simplify by checking node-equality.

From-SVN: r244576
parent 2c65d990
2017-01-18 Nathan Sidwell <nathan@acm.org> 2017-01-18 Nathan Sidwell <nathan@acm.org>
* cp-tree.h: Clarify exception spec node comment.
* except.c (nothrow_spec_p): Simplify by checking node-equality.
PR c++/79091 PR c++/79091
* mangle.c (write_exception_spec): Check nothrow explicitly. * mangle.c (write_exception_spec): Check nothrow explicitly.
(write_encoding): Don't increment processing_template_decl around (write_encoding): Don't increment processing_template_decl around
......
...@@ -1212,7 +1212,8 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; ...@@ -1212,7 +1212,8 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] #define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] #define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
/* Exception specifier used for throw(). */ /* Exception specifiers used for throw(), noexcept(true) and
noexcept(false). We rely on these being uncloned. */
#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] #define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
#define noexcept_true_spec cp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC] #define noexcept_true_spec cp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC]
#define noexcept_false_spec cp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC] #define noexcept_false_spec cp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]
......
...@@ -1143,15 +1143,17 @@ bool ...@@ -1143,15 +1143,17 @@ bool
nothrow_spec_p (const_tree spec) nothrow_spec_p (const_tree spec)
{ {
gcc_assert (!DEFERRED_NOEXCEPT_SPEC_P (spec)); gcc_assert (!DEFERRED_NOEXCEPT_SPEC_P (spec));
if (spec == NULL_TREE
|| TREE_VALUE (spec) != NULL_TREE if (spec == empty_except_spec
|| spec == noexcept_false_spec)
return false;
if (TREE_PURPOSE (spec) == NULL_TREE
|| spec == noexcept_true_spec) || spec == noexcept_true_spec)
return true; return true;
gcc_assert (processing_template_decl
|| TREE_PURPOSE (spec) == error_mark_node); gcc_assert (!spec
|| TREE_VALUE (spec)
|| spec == noexcept_false_spec
|| TREE_PURPOSE (spec) == error_mark_node
|| processing_template_decl);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment