Add testcase of PR c++/92536, already fixed.
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 20 Jan 2020 10:17:19 +0000 (11:17 +0100)
committerPaolo Carlini <paolo.carlini@oracle.com>
Mon, 20 Jan 2020 10:17:19 +0000 (11:17 +0100)
PR c++/92536
* g++.dg/cpp1z/pr92536.C: New.

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/pr92536.C [new file with mode: 0644]

index cae0c163e39f84e66f157e321967a5f9bf47bc4f..888f2cddb0275aa0b0dc11aeef765cd3f80c5711 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/92536
+       * g++.dg/cpp1z/pr92536.C: New.
+
 2020-01-20  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/93094
diff --git a/gcc/testsuite/g++.dg/cpp1z/pr92536.C b/gcc/testsuite/g++.dg/cpp1z/pr92536.C
new file mode 100644 (file)
index 0000000..035c769
--- /dev/null
@@ -0,0 +1,23 @@
+// { dg-do compile { target c++17 } }
+
+namespace std
+{
+  struct stop_token { };
+
+  template<typename Callback>
+    struct stop_callback
+    {
+      template<typename C>
+      stop_callback(stop_token, C&&) { }
+    };
+
+template<typename _Callback>
+    stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
+}
+
+int main()
+{
+  std::stop_token tok;
+  std::function<void()> f([](){});  // { dg-error "not a member|not declared" }
+  std::stop_callback cb(tok, f);
+}