Commit ac90ae18 by Douglas Gregor Committed by Doug Gregor

re PR c++/34399 (ICE on invalid friend declaration of variadic template)

2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34399
	* friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
	know we have a class type.

2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34399
	* g++.dg/cpp0x/vt-34399.C: New.
	* g++.dg/template/friend50.C: New.

From-SVN: r131552
parent 44b962f2
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34399
* friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
know we have a class type.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34751
* pt.c (coerce_template_parameter_pack): When substituting into
the type of a non-type template parameter pack. use the
......
......@@ -468,7 +468,7 @@ do_friend (tree ctype, tree declarator, tree decl,
the process of being defined. */
if (class_template_depth
|| COMPLETE_TYPE_P (ctype)
|| TYPE_BEING_DEFINED (ctype))
|| (CLASS_TYPE_P (ctype) && TYPE_BEING_DEFINED (ctype)))
{
if (DECL_TEMPLATE_INFO (decl))
/* DECL is a template specialization. No need to
......
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34399
* g++.dg/cpp0x/vt-34399.C: New.
* g++.dg/template/friend50.C: New.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34751
* g++.dg/cpp0x/vt-34751.C: New.
// { dg-options "-std=c++0x" }
template<int...> struct A
{
void foo();
};
struct B
{
template<int N> friend void A<N>::A::foo(); // { dg-error "declared as friend" }
};
// PR c++/34399
template<int> struct X
{
void foo();
};
struct Y {
template<long N> friend void X<N>::X::foo(); // { dg-error "declared as friend" }
};
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