Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/cpp1y/pr87410.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/cpp1y/pr87410.C Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,19 @@ +// PR c++/87410 +// { dg-do compile { target c++14 } } + +template <long a> using b = const char[a]; +template <typename, int c, int e, typename f> +constexpr auto g(b<c> &, b<e> &, f) {} +template <typename d, int a> auto h(b<a> &) { + auto i = j(static_cast<d **>(nullptr)); + return **i; +} +class k { + using l = k; + const int &m() const; + friend constexpr auto j(l **n) -> decltype(n) { + g<int>("", "", static_cast<const int &(k::*)() const>(&k::m)); + return n; + } +}; +k o = h<k, 1>("");