diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-08-19 08:06:17 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-08-19 08:06:17 +0000 |
commit | 40242ccfbdcd0a8951320221219e1b6e86cd3d7b (patch) | |
tree | d724306354e6410faeef1eded4ca3830ddf7a1de | |
parent | 4c44366adbe43f18360fdf61ceb4586d0f3144fb (diff) | |
download | gcc-40242ccfbdcd0a8951320221219e1b6e86cd3d7b.zip gcc-40242ccfbdcd0a8951320221219e1b6e86cd3d7b.tar.gz gcc-40242ccfbdcd0a8951320221219e1b6e86cd3d7b.tar.bz2 |
cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
* cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
* decl2.c (build_expr_from_tree): Handle it.
* error.c (dump_expr): Likewise.
* pt.c (for_each_template_parm): Likewise.
(tsubst_copy): Likewise.
* tree.c (search_tree): Likewise.
* semantics.c (finish_pseudo_destructor_call): Create it.
From-SVN: r28760
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/cp-tree.def | 1 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 6 | ||||
-rw-r--r-- | gcc/cp/error.c | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 3 | ||||
-rw-r--r-- | gcc/cp/tree.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/crash48.C | 8 |
8 files changed, 39 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6e44c4f..443cdd5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +1999-08-19 Mark Mitchell <mark@codesourcery.com> + + * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code. + * decl2.c (build_expr_from_tree): Handle it. + * error.c (dump_expr): Likewise. + * pt.c (for_each_template_parm): Likewise. + (tsubst_copy): Likewise. + * tree.c (search_tree): Likewise. + * semantics.c (finish_pseudo_destructor_call): Create it. + 1999-08-18 Mark Mitchell <mark@codesourcery.com> * search.c (setup_class_bindings): Robustify. diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 1970922..d31d33e 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -214,6 +214,7 @@ DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1) DEFTREECODE (ARROW_EXPR, "arrow_expr", 'e', 1) DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", 'e', 2) DEFTREECODE (TYPEID_EXPR, "typeid_expr", 'e', 1) +DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3) DEFTREECODE (EXPR_STMT, "expr_stmt", 'e', 1) DEFTREECODE (COMPOUND_STMT, "compound_stmt", 'e', 1) diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a0a7e6c..ecfdd61 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3992,6 +3992,12 @@ build_expr_from_tree (t) build_expr_from_tree (TREE_OPERAND (t, 1)), build_expr_from_tree (TREE_OPERAND (t, 2))); + case PSEUDO_DTOR_EXPR: + return (finish_pseudo_destructor_call_expr + (build_expr_from_tree (TREE_OPERAND (t, 0)), + build_expr_from_tree (TREE_OPERAND (t, 1)), + build_expr_from_tree (TREE_OPERAND (t, 2)))); + case TREE_LIST: { tree purpose, value, chain; diff --git a/gcc/cp/error.c b/gcc/cp/error.c index ce0ffbf..b6598ff 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1776,6 +1776,14 @@ dump_expr (t, nop) dump_expr (TREE_OPERAND (t, 0), nop); break; + case PSEUDO_DTOR_EXPR: + dump_expr (TREE_OPERAND (t, 2), nop); + OB_PUTS ("."); + dump_type (TREE_OPERAND (t, 0), nop); + OB_PUTS ("::~"); + dump_type (TREE_OPERAND (t, 1), nop); + break; + case TEMPLATE_ID_EXPR: dump_decl (t, 0); break; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9a31d60..e1e8ab4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4300,6 +4300,7 @@ for_each_template_parm (t, fn, data) case DOTSTAR_EXPR: case TYPEID_EXPR: case LOOKUP_EXPR: + case PSEUDO_DTOR_EXPR: if (!fn) return 1; /* Fall through. */ @@ -7078,6 +7079,7 @@ tsubst_copy (t, args, complain, in_decl) case COND_EXPR: case MODOP_EXPR: + case PSEUDO_DTOR_EXPR: { r = build_nt (code, tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl), diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index dc6b541..def1276 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1229,6 +1229,9 @@ finish_pseudo_destructor_call_expr (object, scope, destructor) tree scope; tree destructor; { + if (processing_template_decl) + return build_min_nt (PSEUDO_DTOR_EXPR, object, scope, destructor); + if (scope && scope != destructor) cp_error ("destructor specifier `%T::~%T()' must have matching names", scope, destructor); diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d159ac1..8d36753 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1675,6 +1675,7 @@ search_tree (t, func) case ARROW_EXPR: case DOTSTAR_EXPR: case TYPEID_EXPR: + case PSEUDO_DTOR_EXPR: break; case COMPLEX_CST: diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash48.C b/gcc/testsuite/g++.old-deja/g++.pt/crash48.C new file mode 100644 index 0000000..907360b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash48.C @@ -0,0 +1,8 @@ +// Build don't link: +// Origin: Jean-Francois Panisset <panisset@discreet.com> + +template<class T> +void foo(T *data) +{ + ((char *)data)->~T(); +} |