Commit bae0ffb5 by Paolo Carlini Committed by Paolo Carlini

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
parent ff630487
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> 2017-10-30 Nathan Sidwell <nathan@acm.org>
* call.c (build_op_call_1): Test for FUNCTION_DECL in same manner * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
......
...@@ -17079,8 +17079,7 @@ tsubst_copy_and_build (tree t, ...@@ -17079,8 +17079,7 @@ tsubst_copy_and_build (tree t,
/* A type conversion to reference type will be enclosed in /* A type conversion to reference type will be enclosed in
such an indirect ref, but the substitution of the cast such an indirect ref, but the substitution of the cast
will have also added such an indirect ref. */ 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 else
r = build_x_indirect_ref (input_location, r, RO_UNARY_STAR, r = build_x_indirect_ref (input_location, r, RO_UNARY_STAR,
......
2017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82085
* g++.dg/cpp1y/var-templ56.C: New.
2017-10-30 Nathan Sidwell <nathan@acm.org> 2017-10-30 Nathan Sidwell <nathan@acm.org>
* g++.dg/other/operator2.C: Adjust diagnostic. * g++.dg/other/operator2.C: Adjust diagnostic.
......
// PR c++/82085
// { dg-do compile { target c++14 } }
template <const char& V>
using char_sequence_t = int;
template <typename T>
constexpr char name_of_v = 'x';
template <typename T>
using type = char_sequence_t<name_of_v<T>>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment