diff options
author | Nathan Sidwell <nathan@acm.org> | 2016-05-20 20:58:21 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2016-05-20 20:58:21 +0000 |
commit | 4727d4c6a81774e9b1de91a5e7089c6d17cc6d37 (patch) | |
tree | 0aa8e629502c8c34310859ed6f57fd064a043dd0 /gcc | |
parent | 86e1c0b36f17f3a4153f982f1c5cf19bb867580e (diff) | |
download | gcc-4727d4c6a81774e9b1de91a5e7089c6d17cc6d37.zip gcc-4727d4c6a81774e9b1de91a5e7089c6d17cc6d37.tar.gz gcc-4727d4c6a81774e9b1de91a5e7089c6d17cc6d37.tar.bz2 |
constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if ...
* constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
... goto.
(cxx_eval_call_expression): Fix comment grammar.
From-SVN: r236543
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 26 |
2 files changed, 19 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 06c38c6..9618a28 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-05-20 Nathan Sidwell <nathan@acm.org> + + * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if + ... goto. + (cxx_eval_call_expression): Fix comment grammar. + 2016-05-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/70572 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 6054d1a..7b56260 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1201,18 +1201,18 @@ cxx_bind_parameters_in_call (const constexpr_ctx *ctx, tree t, /* Just discard ellipsis args after checking their constantitude. */ if (!parms) continue; - if (*non_constant_p) - /* Don't try to adjust the type of non-constant args. */ - goto next; - - /* Make sure the binding has the same type as the parm. */ - if (TREE_CODE (type) != REFERENCE_TYPE) - arg = adjust_temp_type (type, arg); - if (!TREE_CONSTANT (arg)) - *non_constant_args = true; - *p = build_tree_list (parms, arg); - p = &TREE_CHAIN (*p); - next: + + if (!*non_constant_p) + { + /* Make sure the binding has the same type as the parm. But + only for constant args. */ + if (TREE_CODE (type) != REFERENCE_TYPE) + arg = adjust_temp_type (type, arg); + if (!TREE_CONSTANT (arg)) + *non_constant_args = true; + *p = build_tree_list (parms, arg); + p = &TREE_CHAIN (*p); + } parms = TREE_CHAIN (parms); } } @@ -1420,7 +1420,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t, *slot = entry = ggc_alloc<constexpr_call> (); *entry = new_call; } - /* Calls which are in progress have their result set to NULL + /* Calls that are in progress have their result set to NULL, so that we can detect circular dependencies. */ else if (entry->result == NULL) { |