aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-11-12 23:48:25 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-11-12 23:48:25 +0000
commit662eceda1dd197b215822a8fa4d636350bf731bb (patch)
treedc96649f06a0a81734786c3bb79e2278ae5cdfeb /gcc
parent0c7c472e8833a0538326f2ddf0fcfb01b25531d5 (diff)
downloadgcc-662eceda1dd197b215822a8fa4d636350bf731bb.zip
gcc-662eceda1dd197b215822a8fa4d636350bf731bb.tar.gz
gcc-662eceda1dd197b215822a8fa4d636350bf731bb.tar.bz2
tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like CONSTRUCTOR.
* tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like CONSTRUCTOR. From-SVN: r73521
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/tree.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f74ac5e..0584924 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 63fdb94..c14289d 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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);