1 // { dg-do assemble } 2 // Origin: Jakub Jelinek <jakub@redhat.com> 3 4 class foo { 5 public: 6 class __iterator; 7 friend class __iterator; 8 typedef __iterator const_iterator; ~foo()9 virtual ~foo() { } 10 __iterator begin(); // { dg-message "foo::begin|no known conversion for implicit" } 11 }; iteratorTest(const foo & x)12static void iteratorTest(const foo &x) 13 { 14 foo::const_iterator i = x.begin(); // { dg-error "incomplete type" "incomplete type" } 15 // { dg-message "candidate" "candidate note" { target *-*-* } 14 } 16 // { dg-error "no matching" "no matching" { target *-*-* } 14 } 17 for (; i; ++i) 18 *i; 19 } 20