| 1 |
// { dg-do compile } |
| 2 |
// { dg-additional-options "-fisolate-erroneous-paths-attribute" } |
| 3 |
|
| 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(); |
| 13 |
}; |
| 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; |
| 19 |
|
| 20 |
public: |
| 21 |
typedef decltype(__test<_Del>()) type; |
| 22 |
}; |
| 23 |
|
| 24 |
public: |
| 25 |
typename I<_Tp>::type operator*() { |
| 26 |
typename G::type a = 0; |
| 27 |
return *a; |
| 28 |
} |
| 29 |
}; |
| 30 |
class H { |
| 31 |
F<A> Out; |
| 32 |
H(); |
| 33 |
}; |
| 34 |
void fn1(void *, void *, int) __attribute__((__nonnull__)); |
| 35 |
class A { |
| 36 |
int OutBufEnd, OutBufCur; |
| 37 |
|
| 38 |
public: |
| 39 |
void operator<<(C p1) { |
| 40 |
int b, c = p1.size(); |
| 41 |
if (OutBufEnd) |
| 42 |
fn1(&OutBufCur, &b, c); |
| 43 |
} |
| 44 |
}; |
| 45 |
char* a; |
| 46 |
H::H() { *Out << a; } |