diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-25 10:47:15 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-25 10:47:15 +0200 |
commit | e16f1cc79dc131b0762cec4c18cfcd795fb6fe75 (patch) | |
tree | 2d1523ca1b3160a1e7eafa9814f6a920b91ac43e /gcc/cp/constexpr.c | |
parent | 080c5459776a70bf6dc9c3410361011591667951 (diff) | |
download | gcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.zip gcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.tar.gz gcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.tar.bz2 |
internal-fn.def (LAUNDER): New internal function.
* internal-fn.def (LAUNDER): New internal function.
* internal-fn.c (expand_LAUNDER): New function.
c-family/
* c-common.h (enum rid): Add RID_BUILTIN_LAUNDER.
* c-common.c (c_common_reswords): Add __builtin_launder.
cp/
* cp-tree.h (finish_builtin_launder): Declare.
* parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_LAUNDER.
* semantics.c (finish_builtin_launder): New function.
* pt.c (tsubst_copy_and_build): Handle instantiation of IFN_LAUNDER.
* constexpr.c (cxx_eval_internal_function): Handle IFN_LAUNDER.
(potential_constant_expression_1): Likewise.
testsuite/
* g++.dg/cpp1z/launder1.C: New test.
* g++.dg/cpp1z/launder2.C: New test.
From-SVN: r241506
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 3c4fcfa..8f7b7f3 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1330,6 +1330,10 @@ cxx_eval_internal_function (const constexpr_ctx *ctx, tree t, opcode = MULT_EXPR; break; + case IFN_LAUNDER: + return cxx_eval_constant_expression (ctx, CALL_EXPR_ARG (t, 0), + false, non_constant_p, overflow_p); + default: if (!ctx->quiet) error_at (EXPR_LOC_OR_LOC (t, input_location), @@ -4920,6 +4924,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, case IFN_ADD_OVERFLOW: case IFN_SUB_OVERFLOW: case IFN_MUL_OVERFLOW: + case IFN_LAUNDER: bail = false; default: |