]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/86524
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Dec 2018 19:58:36 +0000 (19:58 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Dec 2018 19:58:36 +0000 (19:58 +0000)
commit4749c4aca9f4eb02a5462a55e96454b51a19201a
treeed1257ff8ce1315fa49456373bd5eb9b09f61635
parentf8cec2ce74dfeb4e00209350579ef41cdb53d1e8
PR c++/86524
PR c++/88446
* cp-tree.h (cp_fold_maybe_rvalue, cp_fold_rvalue): Declare.
(fold_non_dependent_expr): Add manifestly_const_eval argument.
* constexpr.c (cxx_eval_builtin_function_call): Evaluate
__builtin_constant_p if ctx->manifestly_const_eval even in constexpr
functions.  Don't reuse dummy{1,2} vars between different arguments.
Use cp_fold_rvalue instead of cp_fully_fold.  Fix comment typo.
(fold_non_dependent_expr): Add manifestly_const_eval argument, pass
it through to cxx_eval_outermost_constant_expr and
maybe_constant_value.
* cp-gimplify.c (cp_fold_maybe_rvalue, cp_fold_rvalue): No longer
static.
* semantics.c (finish_static_assert): Call fold_non_dependent_expr
with true as manifestly_const_eval.

* g++.dg/cpp1y/constexpr-86524.C: New test.
* g++.dg/cpp2a/is-constant-evaluated4.C: New test.
* g++.dg/cpp2a/is-constant-evaluated5.C: New test.
* g++.dg/cpp2a/is-constant-evaluated6.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267341 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-tree.h
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/constexpr-86524.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated6.C [new file with mode: 0644]