diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-02-27 05:30:00 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-02-27 05:30:00 +0000 |
commit | 22e92ac3b66eb7aa4d43178ec6d629bccc97cd21 (patch) | |
tree | 807140fc35a0fe684f37c2a6fd0bc7d831e4bf49 /gcc | |
parent | 4278955754174d9c305a87d1e6bf43a1eed25618 (diff) | |
download | gcc-22e92ac3b66eb7aa4d43178ec6d629bccc97cd21.zip gcc-22e92ac3b66eb7aa4d43178ec6d629bccc97cd21.tar.gz gcc-22e92ac3b66eb7aa4d43178ec6d629bccc97cd21.tar.bz2 |
semantics.c (simplify_aggr_init_exprs_p): Don't walk into types.
* semantics.c (simplify_aggr_init_exprs_p): Don't walk into
types.
From-SVN: r32210
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/defarg4.C | 27 |
3 files changed, 44 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7c73df6..af946b3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-02-26 Mark Mitchell <mark@codesourcery.com> + + * semantics.c (simplify_aggr_init_exprs_p): Don't walk into + types. + 2000-02-25 Alfred Minarik <a8601248@unet.univie.ac.at> * rtti.c (get_vmi_pseudo_type_info): Move __vmi_class_type_info diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 52ab681..ad961f8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2618,9 +2618,19 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data) tree call_type; int copy_from_buffer_p; - /* Only AGGR_INIT_EXPRs are interesting. */ aggr_init_expr = *tp; - if (TREE_CODE (aggr_init_expr) != AGGR_INIT_EXPR) + /* We don't need to walk into types; there's nothing in a type that + needs simplification. (And, furthermore, there are places we + actively don't want to go. For example, we don't want to wander + into the default arguments for a FUNCTION_DECL that appears in a + CALL_EXPR.) */ + if (TYPE_P (aggr_init_expr)) + { + *walk_subtrees = 0; + return NULL_TREE; + } + /* Only AGGR_INIT_EXPRs are interesting. */ + else if (TREE_CODE (aggr_init_expr) != AGGR_INIT_EXPR) return NULL_TREE; /* Form an appropriate CALL_EXPR. */ diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg4.C b/gcc/testsuite/g++.old-deja/g++.other/defarg4.C new file mode 100644 index 0000000..87ad4fc --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/defarg4.C @@ -0,0 +1,27 @@ +// Origin: scott snyder <snyder@fnal.gov> + +class complex +{ +public: + complex(); +}; + +struct MLC33 +{ + MLC33( const complex& = complex() ); +}; + +void EmptyClone() +{ + MLC33(); +} + +void makeM33() +{ + MLC33(); +} + +void Clone() +{ + MLC33(); +} |