Commit 206b48e4 by Paolo Carlini Committed by Paolo Carlini

re PR c++/58596 ([c++11] ICE with decltype in non-static data member initializer)

/cp
2013-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58596
	* lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
	cp_unevaluated_operand case.

/testsuite
2013-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58596
	* g++.dg/cpp0x/lambda/lambda-nsdmi5.C: New

From-SVN: r203780
parent f541a481
2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58596
* lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
cp_unevaluated_operand case.
2013-10-16 Jason Merrill <jason@redhat.com>
* pt.c (apply_late_template_attributes): Use
......
......@@ -628,7 +628,14 @@ lambda_expr_this_capture (tree lambda)
/* In unevaluated context this isn't an odr-use, so just return the
nearest 'this'. */
if (cp_unevaluated_operand)
return lookup_name (this_identifier);
{
/* In an NSDMI the fake 'this' pointer that we're using for
parsing is in scope_chain. */
if (LAMBDA_EXPR_EXTRA_SCOPE (lambda)
&& TREE_CODE (LAMBDA_EXPR_EXTRA_SCOPE (lambda)) == FIELD_DECL)
return scope_chain->x_current_class_ptr;
return lookup_name (this_identifier);
}
/* Try to default capture 'this' if we can. */
if (!this_capture
......
2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58596
* g++.dg/cpp0x/lambda/lambda-nsdmi5.C: New
2013-10-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/c-output-template.c: New testcase.
......
// PR c++/58596
// { dg-do compile { target c++11 } }
struct A
{
int i = [] { return decltype(i)(); }();
};
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