diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2017-10-30 19:16:29 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2017-10-30 19:16:29 +0000 |
commit | bae0ffb560161297affa64d94aede0b8c5553a5f (patch) | |
tree | 795f87fb0cbf1566ce93c91214caa18eed1c7b43 /gcc/cp | |
parent | ff6304874e9f0c56ef675deb7f71124348fae922 (diff) | |
download | gcc-bae0ffb560161297affa64d94aede0b8c5553a5f.zip gcc-bae0ffb560161297affa64d94aede0b8c5553a5f.tar.gz gcc-bae0ffb560161297affa64d94aede0b8c5553a5f.tar.bz2 |
re PR c++/82085 (ICE: Template variable reference used in nested template alias)
/cp
2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82085
* pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
unconditionally call convert_from_reference.
/testsuite
2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82085
* g++.dg/cpp1y/var-templ56.C: New.
From-SVN: r254239
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7630638..f1809f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-10-30 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/82085 + * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P, + unconditionally call convert_from_reference. + 2017-10-30 Nathan Sidwell <nathan@acm.org> * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9457aea..8b89ca9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17079,8 +17079,7 @@ tsubst_copy_and_build (tree t, /* A type conversion to reference type will be enclosed in such an indirect ref, but the substitution of the cast will have also added such an indirect ref. */ - if (TREE_CODE (TREE_TYPE (r)) == REFERENCE_TYPE) - r = convert_from_reference (r); + r = convert_from_reference (r); } else r = build_x_indirect_ref (input_location, r, RO_UNARY_STAR, |