diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/friend11.C')
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/friend11.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/friend11.C b/gcc/testsuite/g++.dg/lookup/friend11.C new file mode 100644 index 000000000..2b4ffda83 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/friend11.C @@ -0,0 +1,23 @@ +/* PR c++/30917 */ +/* This used to ICE */ +/* { dg-do compile } */ + + +class QGList; +unsigned count() { + class QGListIterator { + friend class QGList; + QGListIterator( const QGList & ); // OK, finds ::QGList. + }; + return 0; +} + +// This is valid. +unsigned count2() { + class QGList2; + class QGListIterator2 { + friend class QGList2; + QGListIterator2( const QGList2 & ); + }; + return 0; +} |