typeck.c (cp_build_function_call_vec): When mark_used fails unconditionally return...
authorPaolo Carlini <paolo.carlini@oracle.com>
Sat, 11 May 2019 07:50:22 +0000 (07:50 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 11 May 2019 07:50:22 +0000 (07:50 +0000)
/cp
2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>

* typeck.c (cp_build_function_call_vec): When mark_used fails
unconditionally return error_mark_node.

/testsuite
2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C: New.
* g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C: Likewise.

From-SVN: r271091

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C [new file with mode: 0644]

index 33614ef49ecf88542ae6968a753d80951ff38a7f..3da2493f08cc43677af246f752195ddf860bbbaa 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * typeck.c (cp_build_function_call_vec): When mark_used fails
+       unconditionally return error_mark_node.
+
 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * decl.c (grokvardecl): Use an accurate location in error message
index fff45cc7d804d471a02b0486ea661e4b9def3be1..d1f965be28016f44861d2ad7c0dc63bfa7ad451e 100644 (file)
@@ -3836,7 +3836,7 @@ cp_build_function_call_vec (tree function, vec<tree, va_gc> **params,
           return error_mark_node;
         }
 
-      if (!mark_used (function, complain) && !(complain & tf_error))
+      if (!mark_used (function, complain))
        return error_mark_node;
       fndecl = function;
 
index 5a579407439e2f75dd2a4a588c7d13585da7d165..2efe608a93e96f0420ad003e2be05da2f74835d6 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C: New.
+       * g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C: Likewise.
+
 2019-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/61968
diff --git a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C
new file mode 100644 (file)
index 0000000..01e4142
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++2a } }
+
+#include <new>
+
+namespace delete_selection_d {
+  struct B {
+    void operator delete(void*) = delete;
+    void operator delete(B *, std::destroying_delete_t) = delete;
+  };
+  void delete_B(B *b) { delete b; }  // { dg-bogus "deleted .* deleted" }
+  // { dg-error "deleted" "" { target c++2a } .-1 }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C b/gcc/testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C
new file mode 100644 (file)
index 0000000..314e2e9
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++2a } }
+
+#include <new>
+
+namespace delete_selection_r {
+  struct B {
+    void operator delete(B *, std::destroying_delete_t) = delete;
+    void operator delete(void*) = delete;
+  };
+  void delete_B(B *b) { delete b; }  // { dg-bogus "deleted .* deleted" }
+  // { dg-error "deleted" "" { target c++2a } .-1 }
+}