| 1 |
// PR c++/98545 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wabi=14 -fabi-compat-version=0" } |
| 4 |
|
| 5 |
class a { |
| 6 |
public: |
| 7 |
a(); |
| 8 |
template <typename b> a(b); |
| 9 |
}; |
| 10 |
template <class = double> using c = a; |
| 11 |
class f { |
| 12 |
protected: |
| 13 |
template <class d, class e> void operator()(d, double, e); |
| 14 |
}; |
| 15 |
class i : f { |
| 16 |
public: |
| 17 |
template <class... g> |
| 18 |
[[gnu::used]] auto h(g...) -> decltype(operator()(g()...)) {} // { dg-warning "mangled name" } |
| 19 |
// { dg-final { scan-assembler "_ZN1i1hIJ1adS1_EEEDTcldtdefpTonclspcvT__EEEDpS2_" } } |
| 20 |
}; |
| 21 |
template <class> class C { |
| 22 |
public: |
| 23 |
template <class j> C(j); |
| 24 |
i k() const; |
| 25 |
int operator()() { |
| 26 |
int l = 10; |
| 27 |
c<> m, n; |
| 28 |
operator()(m, l, n); |
| 29 |
return 0; |
| 30 |
} |
| 31 |
int operator()(c<> &, c<> const &, c<> const &) const; |
| 32 |
template <class d, class e> void k(d m, double gamma, e o) const { |
| 33 |
k().h(m, gamma, o); |
| 34 |
} |
| 35 |
}; |
| 36 |
template <class r> int C<r>::operator()(c<> &, c<> const &, c<> const &) const { |
| 37 |
[&](c<> m, double gamma, c<> o) { k(m, gamma, o); }; |
| 38 |
return 0; |
| 39 |
} |
| 40 |
c<> p = C<double>(p)(); |