Commit b8599b68 by Jason Merrill Committed by Jason Merrill

PR c++/69323 - valid

	* pt.c (instantiate_class_template_1): Set
	processing_template_decl before substituting friend_type.

From-SVN: r233681
parent 4e7bcf32
2016-02-24 Jason Merrill <jason@redhat.com>
PR c++/69323
* pt.c (instantiate_class_template_1): Set
processing_template_decl before substituting friend_type.
016-02-24 Martin Sebor <msebor@redhat.com>
PR c++/69912
......
......@@ -10180,11 +10180,11 @@ instantiate_class_template_1 (tree type)
template <class U> friend class T::C;
otherwise. */
/* Bump processing_template_decl in case this is something like
template <class T> friend struct A<T>::B. */
++processing_template_decl;
friend_type = tsubst (friend_type, args,
tf_warning_or_error, NULL_TREE);
/* Bump processing_template_decl for correct
dependent_type_p calculation. */
++processing_template_decl;
if (dependent_type_p (friend_type))
adjust_processing_template_decl = true;
--processing_template_decl;
......
// PR c++/69323
template<int VALUE>
struct Outer
{
struct StupidValueTrick
{
template<int VAL> friend struct Outer<VAL>::StupidValueTrick;
};
};
typedef Outer<42>::StupidValueTrick GoodValue;
GoodValue good;
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