commit 8cc312abec2ea0f134d6991c0c8e7a070ce611db
Author: Jason Merrill <jason@redhat.com>
Date: Thu May 30 09:59:25 2013 -0400
PR c++/57404
* cp-lang.c (cp_classify_record): Handle structs without
TYPE_LANG_SPECIFIC.
@@ -127,7 +127,8 @@ cxx_dwarf_name (tree t, int verbosity)
static enum classify_record
cp_classify_record (tree type)
{
- if (CLASSTYPE_DECLARED_CLASS (type))
+ if (TYPE_LANG_SPECIFIC (type)
+ && CLASSTYPE_DECLARED_CLASS (type))
return RECORD_IS_CLASS;
return RECORD_IS_STRUCT;
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/57404
+// { dg-options "-std=c++11 -g" }
+
+void f (int i)
+{
+ int a[i];
+ [&a] {};
+}
+
+void g (int i)
+{
+ int a[i];
+ [&a] {} ();
+}