From: Jonathan Wakely Date: Thu, 14 Sep 2023 08:18:34 +0000 (+0100) Subject: libstdc++: Add testcase for std::make_integer_sequence bug [PR111357] X-Git-Tag: basepoints/gcc-15~6147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=557a858f2ead4ae8b64b157d7fd33830a81646d5;p=thirdparty%2Fgcc.git libstdc++: Add testcase for std::make_integer_sequence bug [PR111357] The compiler bug has been fixed on trunk, but this adds a regression test for the library component. libstdc++-v3/ChangeLog: PR c++/111357 * testsuite/20_util/integer_sequence/pr111357.cc: New test. --- diff --git a/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc b/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc new file mode 100644 index 000000000000..1ad06b732afc --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc @@ -0,0 +1,34 @@ +// { dg-do compile { target c++14 } } + +// PR c++/111357 - __integer_pack fails to work with values of dependent type +// convertible to integers in noexcept context + +#include + +using std::integer_sequence; +using std::make_integer_sequence; + +template +void g(integer_sequence) +{} + +template +struct c1 +{ + static constexpr int value = 1; + constexpr operator int() { return value; } +}; + +template +struct R +{ + using S = make_integer_sequence{}>; + + R() noexcept(noexcept(g(S()))) // { dg-bogus "argument to .__integer_pack." } + {} +}; + +int main() +{ + R(); +}