summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-30 19:20:19 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-30 19:20:19 +0000
commitd544dcee0ea5bd120aff284df06e22cb1ba44b37 (patch)
tree62928da9ada44844becbd3d8830a73cbe49ba91e
parent5d6e94a7ca13ab8ff7a46141f8a879e2878abb0d (diff)
downloadgcc-d544dcee0ea5bd120aff284df06e22cb1ba44b37.tar.gz
PR c++/57404
* cp-lang.c (cp_classify_record): Handle structs without TYPE_LANG_SPECIFIC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199456 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/cp-lang.c3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/vla6.C14
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6ccc776580f..ae2c174754e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 47a6004258b..a7fa8e4b1e9 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -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
index 00000000000..b725e7b6f9c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/vla6.C
@@ -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] {} ();
+}