projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e042b3
)
c++: Make PR92654 testcase valid.
author
Jason Merrill
<jason@redhat.com>
Fri, 7 Feb 2020 20:09:14 +0000
(15:09 -0500)
committer
Jason Merrill
<jason@redhat.com>
Fri, 7 Feb 2020 20:09:14 +0000
(15:09 -0500)
gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C
patch
|
blob
|
history
diff --git
a/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C
b/gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda2.C
index fb26ac716d4f892750d735272a90606e0e55ab64..192c82d34fdedadef7407af9dfaec9465d62ba77 100644
(file)
--- 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 <unsigned long> struct C;
+struct A {
+ constexpr operator int () { return 42; }
+};
+template <int I> struct C {
+ static const bool ap = I;
+};
template <auto I>
void am() {
[](auto an)
{
- if constexpr (C<an>::ap) ;
// { dg-error "constant" }
- }(
42
);
+ if constexpr (C<an>::ap) ;
+ }(
A{}
);
}
void fn() { am<42>(); }