re PR c++/57404 ([C++11] ICE: SIGSEGV in cp_classify_record with -g)
authorJason Merrill <jason@redhat.com>
Thu, 30 May 2013 19:20:19 +0000 (15:20 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 30 May 2013 19:20:19 +0000 (15:20 -0400)
PR c++/57404
* cp-lang.c (cp_classify_record): Handle structs without
TYPE_LANG_SPECIFIC.

From-SVN: r199456

gcc/cp/ChangeLog
gcc/cp/cp-lang.c
gcc/testsuite/g++.dg/cpp1y/vla6.C [new file with mode: 0644]

index 6ccc776580f874a23c0e0913a0bd5c425b6d50cb..ae2c174754e766c60e0dc813248c8a86f837e770 100644 (file)
@@ -1,5 +1,9 @@
 2013-05-30  Jason Merrill  <jason@redhat.com>
 
+       PR c++/57404
+       * cp-lang.c (cp_classify_record): Handle structs without
+       TYPE_LANG_SPECIFIC.
+
        PR c++/52377
        * class.c (common_enclosing_class): New.
        * cp-tree.h: Declare it.
index 47a6004258bd41a569172a6ab90304c036f26387..a7fa8e4b1e987d86c1f5f4c29365e1cd8d954ad1 100644 (file)
@@ -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;
diff --git a/gcc/testsuite/g++.dg/cpp1y/vla6.C b/gcc/testsuite/g++.dg/cpp1y/vla6.C
new file mode 100644 (file)
index 0000000..b725e7b
--- /dev/null
@@ -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] {} ();
+}