diff options
author | Jason Merrill <jason@redhat.com> | 2011-06-17 16:07:20 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-06-17 16:07:20 -0400 |
commit | f05f61fd73568da443c330faaadfeecba45158d7 (patch) | |
tree | 965100083753d03a9f1f92b6fb414d0045bf7e9e /gcc/cp/pt.c | |
parent | 2516ccfe927c61a98bdd561eea90c7229a6a3cbc (diff) | |
download | gcc-f05f61fd73568da443c330faaadfeecba45158d7.zip gcc-f05f61fd73568da443c330faaadfeecba45158d7.tar.gz gcc-f05f61fd73568da443c330faaadfeecba45158d7.tar.bz2 |
pt.c (tsubst_decl): Handle DECL_VALUE_EXPR on reference.
* pt.c (tsubst_decl): Handle DECL_VALUE_EXPR on reference.
* decl.c (check_initializer): Handle DECL_VALUE_EXPR_P.
From-SVN: r175153
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1008b3b..308aff7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10061,6 +10061,11 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) tree ve = DECL_VALUE_EXPR (t); ve = tsubst_expr (ve, args, complain, in_decl, /*constant_expression_p=*/false); + if (REFERENCE_REF_P (ve)) + { + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); + ve = TREE_OPERAND (ve, 0); + } SET_DECL_VALUE_EXPR (r, ve); } } |