From: Jason Merrill Date: Fri, 7 Feb 2020 20:09:14 +0000 (-0500) Subject: c++: Make PR92654 testcase valid. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8496e135b111424e3c84f3f44c74f2cbe48eed90;p=gcc.git c++: Make PR92654 testcase valid. --- diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C index fb26ac716d4..192c82d34fd 100644 --- a/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C @@ -1,12 +1,17 @@ // PR c++/92654 // { dg-do compile { target c++17 } } -template struct C; +struct A { + constexpr operator int () { return 42; } +}; +template struct C { + static const bool ap = I; +}; template void am() { [](auto an) { - if constexpr (C::ap) ; // { dg-error "constant" } - }(42); + if constexpr (C::ap) ; + }(A{}); } void fn() { am<42>(); }