From: Jakub Jelinek Date: Fri, 14 May 2021 11:24:12 +0000 (+0200) Subject: testsuite: Add testcase for already fixed PR [PR88872] X-Git-Tag: releases/gcc-11.2.0~387 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59973ce8b86f82829fa9f92789ec56461b21b78;p=thirdparty%2Fgcc.git testsuite: Add testcase for already fixed PR [PR88872] 2021-05-14 Jakub Jelinek * g++.dg/cpp1y/pr88872.C: New test. (cherry picked from commit f05627d404038368b99e92ac4df4c29f4ae4a5fa) --- diff --git a/gcc/testsuite/g++.dg/cpp1y/pr88872.C b/gcc/testsuite/g++.dg/cpp1y/pr88872.C new file mode 100644 index 000000000000..3719e395c0ee --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr88872.C @@ -0,0 +1,24 @@ +// PR c++/88872 +// { dg-do compile { target c++14 } } + +struct a { + template constexpr a(b) : c() {} + int c; +}; +void d(); +template constexpr a operator"" _n() { return d; } +struct e; +struct f { + e operator[](int); +}; +struct g { + void h(); + f i; +}; +template struct j { + void k() { [](auto) { constexpr auto l = 2_n; }(keywords); } + int keywords; +}; +using m = j; +class e : public m {}; +void g::h() { i[0].k(); }