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
This commit is contained in:
parent
44b962f21c
commit
ac90ae18fb
5 changed files with 32 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
10
gcc/testsuite/g++.dg/cpp0x/vt-34399.C
Normal file
10
gcc/testsuite/g++.dg/cpp0x/vt-34399.C
Normal file
|
@ -0,0 +1,10 @@
|
|||
// { 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" }
|
||||
};
|
9
gcc/testsuite/g++.dg/template/friend50.C
Normal file
9
gcc/testsuite/g++.dg/template/friend50.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
// 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" }
|
||||
};
|
Loading…
Add table
Reference in a new issue