Commit 8bebb953 by Jason Merrill Committed by Jason Merrill

re PR c++/59271 (a.C:16:21: internal compiler error: in strip_typedefs, at cp/tree.c:1315)

	PR c++/59271
	* lambda.c (build_capture_proxy): Use build_cplus_array_type.

From-SVN: r206193
parent 8fc13bad
2013-12-23 Jason Merrill <jason@redhat.com>
PR c++/59271
* lambda.c (build_capture_proxy): Use build_cplus_array_type.
PR c++/59349
* parser.c (cp_parser_lambda_introducer): Handle empty init.
......
......@@ -377,8 +377,8 @@ build_capture_proxy (tree member)
tree ptr = build_simple_component_ref (object, field);
field = next_initializable_field (DECL_CHAIN (field));
tree max = build_simple_component_ref (object, field);
type = build_array_type (TREE_TYPE (TREE_TYPE (ptr)),
build_index_type (max));
type = build_cplus_array_type (TREE_TYPE (TREE_TYPE (ptr)),
build_index_type (max));
type = build_reference_type (type);
REFERENCE_VLA_OK (type) = true;
object = convert (type, ptr);
......
// PR c++/59271
// { dg-options -std=c++1y }
extern "C" int printf (const char *, ...);
void f(int n)
{
int a[n];
for (auto& i : a)
{
i = &i - a;
}
[&a] (auto m)
{
for (auto i : a)
{
printf ("%d", i);
}
return m;
};
}
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