1 // PR c++/83958
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
4 
5 template <typename = void> struct A;
6 class B;
7 template <typename, typename, typename = A<>> class C;
8 template <typename, typename> struct D;
9 template <typename T, typename U, typename V, typename, typename, typename W>
10 struct E {
11   using X = W;
12   X operator* ();
13   T operator++ ();
14   template <typename P, typename R, typename S, typename Q>
15   bool operator!= (E<P, U, V, R, S, Q>);
16 };
17 template <typename T, typename U, typename>
18 struct F {
19   class G;
20   using H = D<T, U>;
21   using I = E<G, T, U, G, H, H &>;
22   class G : public I {};
23   G begin ();
24   G end ();
25 };
26 template <typename T, typename U, typename V> struct C : F<T, U, V> {
27   using J = F<T, U, V>;
28   using J::begin;
29   using J::end;
30 };
31 using K = class L;
32 struct M {
fooM33   void foo () { for (auto & [ a ] : m) {} }	// { dg-error "incomplete type" }
34   C<K, B> m;					// { dg-warning "only available with" "" { target c++14_down } .-1 }
35 };
36