2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr67133.C
blob0f235728bc8d16e36fd971a92de5513e030d7158
1 // { dg-do compile }
2 // { dg-additional-options "-fisolate-erroneous-paths-attribute" }
4 class A;
5 struct B {
6   typedef A type;
7 };
8 template <typename> struct I : B {};
9 class C {
10 public:
11   C(char *);
12   int size();
14 template <typename> struct D;
15 template <typename _Tp, typename = D<_Tp>> class F {
16   class G {
17     template <typename> static _Tp *__test();
18     typedef int _Del;
20   public:
21     typedef decltype(__test<_Del>()) type;
22   };
24 public:
25   typename I<_Tp>::type operator*() {
26     typename G::type a = 0;
27     return *a;
28   }
30 class H {
31   F<A> Out;
32   H();
34 void fn1(void *, void *, int) __attribute__((__nonnull__));
35 class A {
36   int OutBufEnd, OutBufCur;
38 public:
39   void operator<<(C p1) {
40     int b, c = p1.size();
41     if (OutBufEnd)
42       fn1(&OutBufCur, &b, c);
43   }
45 char* a;
46 H::H() { *Out << a; }