public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ Patch] PR 42083
@ 2010-12-09 12:43 Paolo Carlini
  2010-12-15 17:02 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2010-12-09 12:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Hi,

I have this patchlet for an ICE on invalid. Tested x86_64-linux.

Ok for mainline?

Thanks,
Paolo.

//////////////////////

[-- Attachment #2: CL_42083 --]
[-- Type: text/plain, Size: 294 bytes --]

/cp
2010-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42083
	* init.c (build_value_init): Check build_special_member_call return
	value for error_mark_node.

/testsuite
2010-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42083
	* g++.dg/cpp0x/lambda/lambda-ice2.C: New.

[-- Attachment #3: patch_42083 --]
[-- Type: text/plain, Size: 1165 bytes --]

Index: testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C
===================================================================
--- testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C	(revision 0)
+++ testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C	(revision 0)
@@ -0,0 +1,16 @@
+// PR c++/42083
+// { dg-options "-std=c++0x" }
+
+template<typename F>
+decltype(F()) run(F f) // { dg-message "note" }
+{
+  return f();
+}
+
+int main()
+{
+  auto l = []() { return 5; };
+
+  run(l); // { dg-error "no match" }
+  // { dg-message "candidate" "candidate note" { target *-*-* } 14 }
+}
Index: cp/init.c
===================================================================
--- cp/init.c	(revision 167632)
+++ cp/init.c	(working copy)
@@ -314,9 +314,11 @@ build_value_init (tree type, tsubst_flags_t compla
 	  tree ctor = build_special_member_call
 	    (NULL_TREE, complete_ctor_identifier,
 	     NULL, type, LOOKUP_NORMAL, complain);
-
-	  ctor = build_aggr_init_expr (type, ctor);
-	  AGGR_INIT_ZERO_FIRST (ctor) = 1;
+	  if (ctor != error_mark_node)
+	    {
+	      ctor = build_aggr_init_expr (type, ctor);
+	      AGGR_INIT_ZERO_FIRST (ctor) = 1;
+	    }
 	  return ctor;
 	}
     }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [C++ Patch] PR 42083
  2010-12-09 12:43 [C++ Patch] PR 42083 Paolo Carlini
@ 2010-12-15 17:02 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2010-12-15 17:02 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: gcc-patches

On 12/09/2010 06:56 AM, Paolo Carlini wrote:
> Ok for mainline?

OK (and obvious).

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-15 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-09 12:43 [C++ Patch] PR 42083 Paolo Carlini
2010-12-15 17:02 ` 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).