decl.c (grokdeclarator): Properly insert a DECL_EXPR for anonymous VLAs.
authorRichard Biener <rguenther@suse.de>
Mon, 2 May 2016 08:28:33 +0000 (08:28 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 2 May 2016 08:28:33 +0000 (08:28 +0000)
2016-05-02  Richard Biener  <rguenther@suse.de>

cp/
* decl.c (grokdeclarator): Properly insert a DECL_EXPR for
anonymous VLAs.

From-SVN: r235706

gcc/cp/ChangeLog
gcc/cp/decl.c

index 25af3f2603e3e2e66ed06df9a5b01033a04efcf1..792c9c8e6735c944e1462f2a8c7b39fbc9694f78 100644 (file)
@@ -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
index a74e9a24a4ea002df3e034f4425876186b74fe92..5f9031f0664ee480900d12de735cff21539f43f6 100644 (file)
@@ -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)
            {