c++: add fixed test [PR124389]

This one is also fixed by r16-7055.  The testcases from that commit
utilize the concepts satisfaction cache, whereas this one utilizes
the constexpr call cache.

	PR c++/124389
	PR c++/122494

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/static_assert18.C: New test.
This commit is contained in:
Patrick Palka
2026-03-11 10:00:57 -04:00
parent f1065aba22
commit 909d18c291

View File

@@ -0,0 +1,28 @@
// PR c++/124389
// { dg-do compile { target c++11 } }
template <typename T> struct Empty {};
template <typename T>
constexpr bool test(T) noexcept { return true; }
template <typename T>
struct always_true {
static constexpr bool value = true;
static_assert(test(Empty<T>{}), "BUG");
};
template <typename T>
struct AAA {
template <typename U, bool = always_true<U>::value>
AAA(U) {}
};
template <int (*U) (AAA<int>)>
void test_function() {
auto r = U(AAA<int>(1));
}
int main() {
return 0;
}