PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / pr81308-2.C
blob97e3409e06c4fc3d65168c28cf04edf92536c319
1 /* { dg-do compile } */
2 /* { dg-options "-w -O2" } */
4 struct A {
5   int operator[](int) const {}
6 };
7 struct B {
8   void m_fn1();
9 };
10 struct C {
11   virtual bool m_fn2(int, unsigned &, A &, int &, unsigned long &, bool);
13 template <class MCAsmParserImpl> struct D {
14   D(int) { MCAsmParserImpl(0, 0, 0, 0); }
16 int a;
17 namespace {
18 struct F : C {
19   bool m_fn2(int, unsigned &, A &, int &, unsigned long &, bool);
20   unsigned m_fn3(const A &, B &);
21   F(int, int, int, int) {}
24 bool F::m_fn2(int, unsigned &, A &p3, int &, unsigned long &, bool) {
25   B b;
26   m_fn3(p3, b);
28 void fn1() { D<F>(0); }
29 unsigned F::m_fn3(const A &p1, B &p2) {
30   for (int *p;; p++)
31     switch (*p) {
32     case 0:
33       p1[a];
34     case 1:
35       p2.m_fn1();
36     }