* [C++ Patch] PR 58614
@ 2014-12-29 15:19 Paolo Carlini
2015-01-15 10:59 ` [Ping] " Paolo Carlini
2015-01-16 5:05 ` Jason Merrill
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Carlini @ 2014-12-29 15:19 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
Hi,
in this ICE on invalid, we crash during error recovery when
maybe_adjust_types_for_deduction gets an elt which has TREE_TYPE (elt)
== error_mark_node. I think we can simply check for that and return
unify_invalid. Tested x86_64-linux.
Thanks,
Paolo.
/////////////////////////
[-- Attachment #2: CL_58614 --]
[-- Type: text/plain, Size: 287 bytes --]
/cp
2014-12-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58614
* pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
TREE_TYPE (elt) == error_mark_node.
/testsuite
2014-12-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58614
* g++.dg/cpp0x/auto44.C: New.
[-- Attachment #3: patch_58614 --]
[-- Type: text/plain, Size: 983 bytes --]
Index: cp/pt.c
===================================================================
--- cp/pt.c (revision 219098)
+++ cp/pt.c (working copy)
@@ -17857,6 +17857,8 @@ unify (tree tparms, tree targs, tree parm, tree ar
if (!BRACE_ENCLOSED_INITIALIZER_P (elt))
{
tree type = TREE_TYPE (elt);
+ if (type == error_mark_node)
+ return unify_invalid (explain_p);
/* It should only be possible to get here for a call. */
gcc_assert (elt_strict & UNIFY_ALLOW_OUTER_LEVEL);
elt_strict |= maybe_adjust_types_for_deduction
Index: testsuite/g++.dg/cpp0x/auto44.C
===================================================================
--- testsuite/g++.dg/cpp0x/auto44.C (revision 0)
+++ testsuite/g++.dg/cpp0x/auto44.C (working copy)
@@ -0,0 +1,10 @@
+// PR c++/58614
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+void foo()
+{
+ i; // { dg-error "not declared" }
+ auto j = { i }; // { dg-error "unable to deduce" }
+}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ping] [C++ Patch] PR 58614
2014-12-29 15:19 [C++ Patch] PR 58614 Paolo Carlini
@ 2015-01-15 10:59 ` Paolo Carlini
2015-01-16 5:05 ` Jason Merrill
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Carlini @ 2015-01-15 10:59 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
Hi,
pinging this patchlet...
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01926.html
On 12/29/2014 03:54 PM, Paolo Carlini wrote:
> Hi,
>
> in this ICE on invalid, we crash during error recovery when
> maybe_adjust_types_for_deduction gets an elt which has TREE_TYPE (elt)
> == error_mark_node. I think we can simply check for that and return
> unify_invalid. Tested x86_64-linux.
Thanks!
Paolo.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [C++ Patch] PR 58614
2014-12-29 15:19 [C++ Patch] PR 58614 Paolo Carlini
2015-01-15 10:59 ` [Ping] " Paolo Carlini
@ 2015-01-16 5:05 ` Jason Merrill
1 sibling, 0 replies; 3+ messages in thread
From: Jason Merrill @ 2015-01-16 5:05 UTC (permalink / raw)
To: Paolo Carlini, gcc-patches
OK.
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-16 4:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-29 15:19 [C++ Patch] PR 58614 Paolo Carlini
2015-01-15 10:59 ` [Ping] " Paolo Carlini
2015-01-16 5:05 ` 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).