* [C++ Patch] PR 84330 ("[6/7/8 Regression] [concepts] ICE with broken constraint")
@ 2018-02-15 14:29 Paolo Carlini
2018-02-15 17:57 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2018-02-15 14:29 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
Hi,
we have been accumulating quite a few bugs under the [concepts]
meta-bug, most of which of course aren't regressions. This one is a low
hanging fruit, an error recovery issue where, after some meaningful
diagnostic, tsubst_constraint doesn't know how to handle an
error_mark_node. I believe that ideally we should do better, we should
be able to issue only the first error - I think a TODO in
diagnose_constraint hints at that too - but the below should do for now
(well, in 6.1.0 we issued *3* errors ;-)
Thanks, Paolo.
////////////////////
[-- Attachment #2: CL_84330 --]
[-- Type: text/plain, Size: 278 bytes --]
/cp
2018-02-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84330
* constraint.cc (tsubst_constraint_info): Handle an error_mark_node
as first argument.
/testsuite
2018-02-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84330
* g++.dg/concepts/pr84330.C: New.
[-- Attachment #3: patch_84330 --]
[-- Type: text/plain, Size: 911 bytes --]
Index: cp/constraint.cc
===================================================================
--- cp/constraint.cc (revision 257682)
+++ cp/constraint.cc (working copy)
@@ -1918,7 +1918,7 @@ tsubst_constraint_info (tree t, tree args,
tree
tsubst_constraint (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
- if (t == NULL_TREE)
+ if (t == NULL_TREE || t == error_mark_node)
return t;
switch (TREE_CODE (t))
{
Index: testsuite/g++.dg/concepts/pr84330.C
===================================================================
--- testsuite/g++.dg/concepts/pr84330.C (nonexistent)
+++ testsuite/g++.dg/concepts/pr84330.C (working copy)
@@ -0,0 +1,12 @@
+// PR c++/84330
+// { dg-options "-fconcepts" }
+
+struct A
+{
+ template<typename T> requires sizeof(T) >> 0 void foo(T); // { dg-error "predicate constraint" }
+
+ void bar()
+ {
+ foo(0); // { dg-error "no matching" }
+ }
+};
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ Patch] PR 84330 ("[6/7/8 Regression] [concepts] ICE with broken constraint")
2018-02-15 14:29 [C++ Patch] PR 84330 ("[6/7/8 Regression] [concepts] ICE with broken constraint") Paolo Carlini
@ 2018-02-15 17:57 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2018-02-15 17:57 UTC (permalink / raw)
To: Paolo Carlini; +Cc: gcc-patches
OK.
On Thu, Feb 15, 2018 at 9:29 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> we have been accumulating quite a few bugs under the [concepts] meta-bug,
> most of which of course aren't regressions. This one is a low hanging fruit,
> an error recovery issue where, after some meaningful diagnostic,
> tsubst_constraint doesn't know how to handle an error_mark_node. I believe
> that ideally we should do better, we should be able to issue only the first
> error - I think a TODO in diagnose_constraint hints at that too - but the
> below should do for now (well, in 6.1.0 we issued *3* errors ;-)
>
> Thanks, Paolo.
>
> ////////////////////
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-15 17:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15 14:29 [C++ Patch] PR 84330 ("[6/7/8 Regression] [concepts] ICE with broken constraint") Paolo Carlini
2018-02-15 17:57 ` 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).