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
+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
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
--- /dev/null
+// { 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" }
+};
--- /dev/null
+// 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" }
+};