PR c++/59271
* lambda.c (build_capture_proxy): Use build_cplus_array_type.
From-SVN: r206193
2013-12-23 Jason Merrill <jason@redhat.com>
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.
PR c++/59349
* parser.c (cp_parser_lambda_introducer): Handle empty init.
tree ptr = build_simple_component_ref (object, field);
field = next_initializable_field (DECL_CHAIN (field));
tree max = build_simple_component_ref (object, field);
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);
type = build_reference_type (type);
REFERENCE_VLA_OK (type) = true;
object = convert (type, ptr);
--- /dev/null
+// 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;
+ };
+}