diff options
author | Jason Merrill <jason@redhat.com> | 2010-06-04 17:21:13 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-06-04 17:21:13 -0400 |
commit | 0a766368bd6e51459bfd334086cc04af48f91f08 (patch) | |
tree | d5300c246ce3ea5275af264865375de418f7963e /gcc/cp/pt.c | |
parent | d8a0d13e4fad752b3c3d9ff3f97b03407bf8c726 (diff) | |
download | gcc-0a766368bd6e51459bfd334086cc04af48f91f08.zip gcc-0a766368bd6e51459bfd334086cc04af48f91f08.tar.gz gcc-0a766368bd6e51459bfd334086cc04af48f91f08.tar.bz2 |
Implement noexcept operator (5.3.7)
Implement noexcept operator (5.3.7)
* c-common.c (c_common_reswords): Add noexcept.
* c-common.h (enum rid): Add RID_NOEXCEPT.
cp/
* cp-tree.def (NOEXCEPT_EXPR): New.
* except.c (check_noexcept_r, finish_noexcept_expr): New.
* cp-tree.h: Declare finish_noexcept_expr.
* parser.c (cp_parser_unary_expression): Parse noexcept-expression.
* pt.c (tsubst_copy_and_build): And tsubst it.
(type_dependent_expression_p): Handle it.
(value_dependent_expression_p): Handle it.
From-SVN: r160297
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dcb455b..0d58035 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12245,6 +12245,17 @@ tsubst_copy_and_build (tree t, return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t), complain & tf_error); + case NOEXCEPT_EXPR: + op1 = TREE_OPERAND (t, 0); + ++cp_unevaluated_operand; + ++c_inhibit_evaluation_warnings; + op1 = tsubst_copy_and_build (op1, args, complain, in_decl, + /*function_p=*/false, + /*integral_constant_expression_p=*/false); + --cp_unevaluated_operand; + --c_inhibit_evaluation_warnings; + return finish_noexcept_expr (op1); + case MODOP_EXPR: { tree r = build_x_modify_expr @@ -17577,6 +17588,7 @@ value_dependent_expression_p (tree expression) return true; else if (TYPE_P (expression)) return dependent_type_p (expression); + case NOEXCEPT_EXPR: return type_dependent_expression_p (expression); case SCOPE_REF: @@ -17680,6 +17692,7 @@ type_dependent_expression_p (tree expression) if (TREE_CODE (expression) == PSEUDO_DTOR_EXPR || TREE_CODE (expression) == SIZEOF_EXPR || TREE_CODE (expression) == ALIGNOF_EXPR + || TREE_CODE (expression) == NOEXCEPT_EXPR || TREE_CODE (expression) == TRAIT_EXPR || TREE_CODE (expression) == TYPEID_EXPR || TREE_CODE (expression) == DELETE_EXPR |