* [C++ Patch] PR 49776
@ 2011-07-26 12:33 Paolo Carlini
2011-07-26 18:31 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2011-07-26 12:33 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Hi,
another simple fix for an ICE on invalid. Tested x86_64-linux.
Ok?
Thanks,
Paolo.
////////////////////////
[-- Attachment #2: CL_49776 --]
[-- Type: text/plain, Size: 284 bytes --]
/cp
2011-07-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/49776
* typeck.c (cp_build_modify_expr): Check digest_init return value
for error_mark_node.
/testsuite
2011-07-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/49776
* g++.dg/cpp0x/constexpr-49776.C: New.
[-- Attachment #3: patch_49776 --]
[-- Type: text/plain, Size: 995 bytes --]
Index: testsuite/g++.dg/cpp0x/constexpr-49776.C
===================================================================
--- testsuite/g++.dg/cpp0x/constexpr-49776.C (revision 0)
+++ testsuite/g++.dg/cpp0x/constexpr-49776.C (revision 0)
@@ -0,0 +1,17 @@
+// PR c++/49776
+// { dg-options -std=c++0x }
+
+struct s
+{
+ int i[1];
+
+ template<class... Types>
+ constexpr s(Types... args)
+ : i{args...} // { dg-error "cannot convert" }
+ { }
+};
+
+int main()
+{
+ s test = nullptr;
+}
Index: cp/typeck.c
===================================================================
--- cp/typeck.c (revision 176786)
+++ cp/typeck.c (working copy)
@@ -6753,6 +6753,8 @@ cp_build_modify_expr (tree lhs, enum tree_code mod
if (check_array_initializer (lhs, lhstype, newrhs))
return error_mark_node;
newrhs = digest_init (lhstype, newrhs, complain);
+ if (newrhs == error_mark_node)
+ return error_mark_node;
}
else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype),
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ Patch] PR 49776
2011-07-26 12:33 [C++ Patch] PR 49776 Paolo Carlini
@ 2011-07-26 18:31 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2011-07-26 18:31 UTC (permalink / raw)
To: Paolo Carlini; +Cc: gcc-patches
OK.
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-26 18:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26 12:33 [C++ Patch] PR 49776 Paolo Carlini
2011-07-26 18:31 ` 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).