diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1z/constexpr-if14.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/constexpr-if14.C | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-if14.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-if14.C new file mode 100644 index 00000000000..f6cc39a0c2f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if14.C @@ -0,0 +1,14 @@ +// PR c++/84421 +// { dg-options -std=c++17 } + +struct A{ + constexpr operator bool() const { return true; } +}; + +int main(){ + auto f = [](auto v){ + if constexpr(v){} + }; + A a; + f(a); +} |