| 1 |
// PR c++/87410 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
template <long a> using b = const char[a]; |
| 5 |
template <typename, int c, int e, typename f> |
| 6 |
constexpr auto g(b<c> &, b<e> &, f) {} |
| 7 |
template <typename d, int a> auto h(b<a> &) { |
| 8 |
auto i = j(static_cast<d **>(nullptr)); |
| 9 |
return **i; |
| 10 |
} |
| 11 |
class k { |
| 12 |
using l = k; |
| 13 |
const int &m() const; |
| 14 |
friend constexpr auto j(l **n) -> decltype(n) { |
| 15 |
g<int>("", "", static_cast<const int &(k::*)() const>(&k::m)); |
| 16 |
return n; |
| 17 |
} |
| 18 |
}; |
| 19 |
k o = h<k, 1>(""); |