Commit a26e0b81 by Paolo Carlini Committed by Paolo Carlini

re PR c++/47242 ([C++0x] ICE: tree check: expected field_decl, have error_mark…

re PR c++/47242 ([C++0x] ICE: tree check: expected field_decl, have error_mark in build_lambda_object, at cp/semantics.c:7604 on invalid lambda function)

/cp
2011-02-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/47242
	* semantics.c (build_lambda_object): Bail out if a field is
	error_mark_node.

/testsuite
2011-02-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/47242
	* g++.dg/cpp0x/lambda/lambda-ice4.C: New.

From-SVN: r170423
parent b152a615
2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/47242
* semantics.c (build_lambda_object): Bail out if a field is
error_mark_node.
2011-02-22 Dodji Seketeli <dodji@redhat.com> 2011-02-22 Dodji Seketeli <dodji@redhat.com>
PR c++/47666 PR c++/47666
......
...@@ -7795,6 +7795,12 @@ build_lambda_object (tree lambda_expr) ...@@ -7795,6 +7795,12 @@ build_lambda_object (tree lambda_expr)
tree field = TREE_PURPOSE (node); tree field = TREE_PURPOSE (node);
tree val = TREE_VALUE (node); tree val = TREE_VALUE (node);
if (field == error_mark_node)
{
expr = error_mark_node;
goto out;
}
if (DECL_P (val)) if (DECL_P (val))
mark_used (val); mark_used (val);
...@@ -7830,6 +7836,7 @@ build_lambda_object (tree lambda_expr) ...@@ -7830,6 +7836,7 @@ build_lambda_object (tree lambda_expr)
expr = finish_compound_literal (type, expr); expr = finish_compound_literal (type, expr);
CLASSTYPE_NON_AGGREGATE (type) = 1; CLASSTYPE_NON_AGGREGATE (type) = 1;
out:
input_location = saved_loc; input_location = saved_loc;
return expr; return expr;
} }
......
2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/47242
* g++.dg/cpp0x/lambda/lambda-ice4.C: New.
2011-02-23 Jie Zhang <jie@codesourcery.com> 2011-02-23 Jie Zhang <jie@codesourcery.com>
PR rtl-optimization/47763 PR rtl-optimization/47763
...@@ -154,7 +159,7 @@ ...@@ -154,7 +159,7 @@
PR objc/47784 PR objc/47784
* objc.dg/property/dotsyntax-22.m: New. * objc.dg/property/dotsyntax-22.m: New.
* obj-c++.dg/property/dotsyntax-22.mm: New. * obj-c++.dg/property/dotsyntax-22.mm: New.
2011-02-20 Dodji Seketeli <dodji@redhat.com> 2011-02-20 Dodji Seketeli <dodji@redhat.com>
PR c++/46394 PR c++/46394
......
// PR c++/47242
// { dg-options "-std=c++0x" }
template < typename > void
bar ()
{
[i]{}; // { dg-error "declared|invalid" }
}
void
foo ()
{
bar<int>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment