mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 23:31:21 +08:00
c++: Add testcase for already fixed PR [PR103443]
Fixed by r12-7264. PR c++/103443 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval29.C: New test.
This commit is contained in:
parent
73baba1ae1
commit
074d283e24
20
gcc/testsuite/g++.dg/cpp2a/consteval29.C
Normal file
20
gcc/testsuite/g++.dg/cpp2a/consteval29.C
Normal file
@ -0,0 +1,20 @@
|
||||
// PR c++/103443
|
||||
// { dg-do compile { target c++20 } }
|
||||
|
||||
template<int...>
|
||||
struct A { };
|
||||
|
||||
template<int... Is>
|
||||
consteval unsigned index_sequence2mask(A<Is...>) {
|
||||
if constexpr (sizeof...(Is) == 0u)
|
||||
return 0u;
|
||||
else
|
||||
return ((1u << Is) | ...);
|
||||
}
|
||||
|
||||
template<unsigned Mask = index_sequence2mask(A<1,2,3>{})>
|
||||
void use_mask();
|
||||
|
||||
int main() {
|
||||
use_mask();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user