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.
---
gcc/testsuite/g++.dg/cpp0x/static_assert18.C | 28 ++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/cpp0x/static_assert18.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert18.C
b/gcc/testsuite/g++.dg/cpp0x/static_assert18.C
new file mode 100644
index 000000000000..d38dbf407810
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/static_assert18.C
@@ -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;
+}
--
2.53.0.439.gd181b9354c