* [C++ Patch] Avoid some duplicate error messages
@ 2019-04-29 18:56 Paolo Carlini
2019-05-10 14:44 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2019-04-29 18:56 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
Hi,
I have a small back queue of tweaks of various kinds and sizes, this one
seems small enough to be safe wrt last minute release branch fixes.
While working on the regression c++/88969, some duplicate errors showed
up when we started giving appropriate diagnostics instead of ICEing,
which could be cured by unconditionally returning error_mark_node from
cp_build_function_call_vec when mark_used fails. In general, in the
front-end we have a mix of unconditional and conditional to SFINAE
context mark_used checks, I think it's often a delicate choice, the
below change passes testing, I would give it a spin, at the beginning of
Stage1. Tested x86_64-linux.
Thanks, Paolo.
////////////////////////
[-- Attachment #2: CL_duplicate_1 --]
[-- Type: text/plain, Size: 369 bytes --]
/cp
2019-04-29 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_function_call_vec): When mark_used fails
unconditionally return error_mark_node.
/testsuite
2019-04-29 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.
[-- Attachment #3: patch_duplicate_1 --]
[-- Type: text/plain, Size: 1811 bytes --]
Index: cp/typeck.c
===================================================================
--- cp/typeck.c (revision 270643)
+++ cp/typeck.c (working copy)
@@ -3837,7 +3837,7 @@ cp_build_function_call_vec (tree function, vec<tre
return error_mark_node;
}
- if (!mark_used (function, complain) && !(complain & tf_error))
+ if (!mark_used (function, complain))
return error_mark_node;
fndecl = function;
Index: testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C
===================================================================
--- testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C (nonexistent)
+++ testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C (working copy)
@@ -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 }
+}
Index: testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C
===================================================================
--- testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C (nonexistent)
+++ testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C (working copy)
@@ -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 }
+}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ Patch] Avoid some duplicate error messages
2019-04-29 18:56 [C++ Patch] Avoid some duplicate error messages Paolo Carlini
@ 2019-05-10 14:44 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2019-05-10 14:44 UTC (permalink / raw)
To: Paolo Carlini, gcc-patches
On 4/29/19 2:50 PM, Paolo Carlini wrote:
> Hi,
>
> I have a small back queue of tweaks of various kinds and sizes, this one
> seems small enough to be safe wrt last minute release branch fixes.
>
> While working on the regression c++/88969, some duplicate errors showed
> up when we started giving appropriate diagnostics instead of ICEing,
> which could be cured by unconditionally returning error_mark_node from
> cp_build_function_call_vec when mark_used fails. In general, in the
> front-end we have a mix of unconditional and conditional to SFINAE
> context mark_used checks, I think it's often a delicate choice, the
> below change passes testing, I would give it a spin, at the beginning of
> Stage1. Tested x86_64-linux.
OK.
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-10 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 18:56 [C++ Patch] Avoid some duplicate error messages Paolo Carlini
2019-05-10 14:44 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).