view gcc/testsuite/g++.dg/torture/pr67133.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }
// { dg-additional-options "-fisolate-erroneous-paths-attribute" }

class A;
struct B {
  typedef A type;
};
template <typename> struct I : B {};
class C {
public:
  C(char *);
  int size();
};
template <typename> struct D;
template <typename _Tp, typename = D<_Tp>> class F {
  class G {
    template <typename> static _Tp *__test();
    typedef int _Del;

  public:
    typedef decltype(__test<_Del>()) type;
  };

public:
  typename I<_Tp>::type operator*() {
    typename G::type a = 0;
    return *a;
  }
};
class H {
  F<A> Out;
  H();
};
void fn1(void *, void *, int) __attribute__((__nonnull__));
class A {
  int OutBufEnd, OutBufCur;

public:
  void operator<<(C p1) {
    int b, c = p1.size();
    if (OutBufEnd)
      fn1(&OutBufCur, &b, c);
  }
};
char* a;
H::H() { *Out << a; }