]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add testcase for already fixed PR [PR84689]
authorPatrick Palka <ppalka@redhat.com>
Thu, 22 Apr 2021 17:32:44 +0000 (13:32 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 22 Apr 2021 17:32:44 +0000 (13:32 -0400)
We correctly accept this testcase since r11-1638.

gcc/testsuite/ChangeLog:

PR c++/84689
* g++.dg/cpp0x/sfinae67.C: New test.

gcc/testsuite/g++.dg/cpp0x/sfinae67.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae67.C b/gcc/testsuite/g++.dg/cpp0x/sfinae67.C
new file mode 100644 (file)
index 0000000..cfed92a
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/84689
+// { dg-do compile { target c++11 } }
+
+struct base {
+  void operator()();
+};
+
+struct a : base { };
+struct b : base { };
+
+struct f : a, b {
+  using a::operator();
+  using b::operator();
+};
+
+template <class T> auto g(int) -> decltype(T()());
+template <class T> auto g(...) -> int;
+
+using type = decltype(g<f>(0));
+using type = int;