aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-07-10 16:47:52 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-07-10 16:47:52 +0000
commit4a3864984cd9d020a65cd2956ed032e3cc254a98 (patch)
treeed0e7bf4cb3957e067e0ff6072e1192fdded5502 /gcc/cp/tree.c
parent1e60c0577d2a835744f39c9b82a5564ea9fe11d7 (diff)
downloadgcc-4a3864984cd9d020a65cd2956ed032e3cc254a98.zip
gcc-4a3864984cd9d020a65cd2956ed032e3cc254a98.tar.gz
gcc-4a3864984cd9d020a65cd2956ed032e3cc254a98.tar.bz2
re PR c++/10032 (-pedantic converts some errors to warnings)
PR c++/10032 * doc/invoke.texi (C++ Dialect Options): Change documentation of -fpermissive. PR c++/10032 * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are still errors. PR c++/10527 * error.c (decl_to_string): Do not print default argument expressions. * cp-tree.h (break_out_calls): Remove declaration. * tree.c (break_out_calls): Remove. * typeck.c (build_modify_expr): Avoid invalid sharing of trees. PR c++/10032 * g++.dg/warn/pedantic1.C: New test. From-SVN: r69191
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 366ea3a..7f13734 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -368,86 +368,6 @@ get_target_expr (tree init)
return build_target_expr_with_type (init, TREE_TYPE (init));
}
-/* Recursively perform a preorder search EXP for CALL_EXPRs, making
- copies where they are found. Returns a deep copy all nodes transitively
- containing CALL_EXPRs. */
-
-tree
-break_out_calls (tree exp)
-{
- register tree t1, t2 = NULL_TREE;
- register enum tree_code code;
- register int changed = 0;
- register int i;
-
- if (exp == NULL_TREE)
- return exp;
-
- code = TREE_CODE (exp);
-
- if (code == CALL_EXPR)
- return copy_node (exp);
-
- /* Don't try and defeat a save_expr, as it should only be done once. */
- if (code == SAVE_EXPR)
- return exp;
-
- switch (TREE_CODE_CLASS (code))
- {
- default:
- abort ();
-
- case 'c': /* a constant */
- case 't': /* a type node */
- case 'x': /* something random, like an identifier or an ERROR_MARK. */
- return exp;
-
- case 'd': /* A decl node */
- return exp;
-
- case 'b': /* A block node */
- {
- /* Don't know how to handle these correctly yet. Must do a
- break_out_calls on all DECL_INITIAL values for local variables,
- and also break_out_calls on all sub-blocks and sub-statements. */
- abort ();
- }
- return exp;
-
- case 'e': /* an expression */
- case 'r': /* a reference */
- case 's': /* an expression with side effects */
- for (i = TREE_CODE_LENGTH (code) - 1; i >= 0; i--)
- {
- t1 = break_out_calls (TREE_OPERAND (exp, i));
- if (t1 != TREE_OPERAND (exp, i))
- {
- exp = copy_node (exp);
- TREE_OPERAND (exp, i) = t1;
- }
- }
- return exp;
-
- case '<': /* a comparison expression */
- case '2': /* a binary arithmetic expression */
- t2 = break_out_calls (TREE_OPERAND (exp, 1));
- if (t2 != TREE_OPERAND (exp, 1))
- changed = 1;
- case '1': /* a unary arithmetic expression */
- t1 = break_out_calls (TREE_OPERAND (exp, 0));
- if (t1 != TREE_OPERAND (exp, 0))
- changed = 1;
- if (changed)
- {
- if (TREE_CODE_LENGTH (code) == 1)
- return build1 (code, TREE_TYPE (exp), t1);
- else
- return build (code, TREE_TYPE (exp), t1, t2);
- }
- return exp;
- }
-
-}
/* Construct, lay out and return the type of methods belonging to class
BASETYPE and whose arguments are described by ARGTYPES and whose values