tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like CONSTRUCTOR.
authorMark Mitchell <mark@codesourcery.com>
Wed, 12 Nov 2003 23:48:25 +0000 (23:48 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 12 Nov 2003 23:48:25 +0000 (23:48 +0000)
* tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like
CONSTRUCTOR.

From-SVN: r73521

gcc/cp/ChangeLog
gcc/cp/tree.c

index f74ac5e149135db0470816827f79b4590a90d8bb..0584924080d08b6c5bd1fe24ff93057c15fab8e3 100644 (file)
@@ -1,5 +1,8 @@
 2003-11-12  Mark Mitchell  <mark@codesourcery.com>
 
+       * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like
+       CONSTRUCTOR.
+
        * decl.c (cp_make_fname_decl): When creating a top-level
        __FUNCTION__-like symbol, do register it with pushdecl.
 
index 63fdb948c7f1ea2f226ca39f5e44bdc9a3e34f4a..c14289d0d9031913b94dabe2225e3c29af325aa9 100644 (file)
@@ -312,11 +312,13 @@ build_target_expr_with_type (tree init, tree type)
     return init;
   else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)
           && TREE_CODE (init) != COND_EXPR
-          && TREE_CODE (init) != CONSTRUCTOR)
+          && TREE_CODE (init) != CONSTRUCTOR
+          && TREE_CODE (init) != VA_ARG_EXPR)
     /* We need to build up a copy constructor call.  COND_EXPR is a special
        case because we already have copies on the arms and we don't want
        another one here.  A CONSTRUCTOR is aggregate initialization, which
-       is handled separately.  */
+       is handled separately.  A VA_ARG_EXPR is magic creation of an
+       aggregate; there's no additional work to be done.  */
     return force_rvalue (init);
 
   slot = build_decl (VAR_DECL, NULL_TREE, type);