diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-17 20:17:56 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-17 20:17:56 +0000 |
commit | ba5b9ab335a795fb359588471344e205f89449ef (patch) | |
tree | 6ba13b465e2a25a0a17dad66c10d9b9043cdfe4f /gcc/cp/call.c | |
parent | d85d1efc03a614320861cfbffbf7dade2cb0e32f (diff) | |
download | gcc-ba5b9ab335a795fb359588471344e205f89449ef.tar.gz |
PR c++/50473
* decl.c (cp_finish_decl): Don't try to process a non-dependent
constant initializer for a reference.
* pt.c (value_dependent_expression_p): A reference is always
dependent.
* call.c (extend_ref_init_temps_1): Also clear TREE_SIDE_EFFECTS
on any NOP_EXPRs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 4f0b1725da2..06162aa6286 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -9712,9 +9712,11 @@ extend_ref_init_temps_1 (tree decl, tree init, vec<tree, va_gc> **cleanups) { tree subinit = NULL_TREE; *p = set_up_extended_ref_temp (decl, *p, cleanups, &subinit); + recompute_tree_invariant_for_addr_expr (sub); + if (init != sub) + init = fold_convert (TREE_TYPE (init), sub); if (subinit) init = build2 (COMPOUND_EXPR, TREE_TYPE (init), subinit, init); - recompute_tree_invariant_for_addr_expr (sub); } return init; } |