aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-05-02 08:28:33 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-05-02 08:28:33 +0000
commit02673c66c6477d1212a49a602f74c624267dda29 (patch)
tree765d03062b9d66d98eb7b317fe3c23f660a0f5ed /gcc
parentc83e6ebf120438b41dd1b2a5f8b64ba9699c7992 (diff)
downloadgcc-02673c66c6477d1212a49a602f74c624267dda29.zip
gcc-02673c66c6477d1212a49a602f74c624267dda29.tar.gz
gcc-02673c66c6477d1212a49a602f74c624267dda29.tar.bz2
decl.c (grokdeclarator): Properly insert a DECL_EXPR for anonymous VLAs.
2016-05-02 Richard Biener <rguenther@suse.de> cp/ * decl.c (grokdeclarator): Properly insert a DECL_EXPR for anonymous VLAs. From-SVN: r235706
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 25af3f2..792c9c8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-02 Richard Biener <rguenther@suse.de>
+
+ * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
+ anonymous VLAs.
+
2016-04-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/66644
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a74e9a2..5f9031f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10393,8 +10393,11 @@ grokdeclarator (const cp_declarator *declarator,
&& (decl_context == NORMAL || decl_context == FIELD)
&& at_function_scope_p ()
&& variably_modified_type_p (type, NULL_TREE))
- /* Force evaluation of the SAVE_EXPR. */
- finish_expr_stmt (TYPE_SIZE (type));
+ {
+ TYPE_NAME (type) = build_decl (UNKNOWN_LOCATION, TYPE_DECL,
+ NULL_TREE, type);
+ add_decl_expr (TYPE_NAME (type));
+ }
if (declarator->kind == cdk_reference)
{