aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-07-24 12:36:55 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-07-24 08:36:55 -0400
commitc6160f8f95bf00d19cf87e7840c60b4d61177594 (patch)
treeb4113c71ed83166b25cce0aa63bb3e0440a41d7f /gcc
parent0d1be5835ffeeb5a0320569a02f0dc8a22212052 (diff)
downloadgcc-c6160f8f95bf00d19cf87e7840c60b4d61177594.zip
gcc-c6160f8f95bf00d19cf87e7840c60b4d61177594.tar.gz
gcc-c6160f8f95bf00d19cf87e7840c60b4d61177594.tar.bz2
cp-tree.h: Add prototype for set_identifier_local_value.
* cp-tree.h: Add prototype for set_identifier_local_value. * decl.c (set_identifier_local_value_with_scope): Make static, prototype. * search.c (covariant_return_p): Likewise. * except.c (build_terminate_handler, alloc_eh_object): Likewise. * call.c (build_method_call): Only pull out the type of a destructor if it's a template type parm. * decl.c (lookup_name_real): Never return the from_obj value. From-SVN: r21361
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c7
-rw-r--r--gcc/cp/except.c6
-rw-r--r--gcc/cp/search.c3
6 files changed, 27 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c580d55..ebf049e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cp-tree.h: Add prototype for set_identifier_local_value.
+ * decl.c (set_identifier_local_value_with_scope): Make static,
+ prototype.
+ * search.c (covariant_return_p): Likewise.
+ * except.c (build_terminate_handler, alloc_eh_object): Likewise.
+
+ * call.c (build_method_call): Only pull out the type of a destructor
+ if it's a template type parm.
+ * decl.c (lookup_name_real): Never return the from_obj value.
+
1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
* except.c (process_start_catch_block_old): Call start_decl_1 for
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 3e11a74..936dcb6 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -626,11 +626,13 @@ build_method_call (instance, name, parms, basetype_path, flags)
if (processing_template_decl)
{
+ /* We need to process template parm names here so that tsubst catches
+ them properly. Other type names can wait. */
if (TREE_CODE (name) == BIT_NOT_EXPR
&& TREE_CODE (TREE_OPERAND (name, 0)) == IDENTIFIER_NODE)
{
tree type = get_aggr_from_typedef (TREE_OPERAND (name, 0), 0);
- if (type)
+ if (type && TREE_CODE (type) == TEMPLATE_TYPE_PARM)
name = build_min_nt (BIT_NOT_EXPR, type);
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index c433e7a..7572921 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2358,6 +2358,7 @@ extern void push_to_top_level PROTO((void));
extern void pop_from_top_level PROTO((void));
extern tree identifier_type_value PROTO((tree));
extern void set_identifier_type_value PROTO((tree, tree));
+extern void set_identifier_local_value PROTO((tree, tree));
extern void pop_everything PROTO((void));
extern void pushtag PROTO((tree, tree, int));
extern tree make_anon_name PROTO((void));
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 87c2fd0..f25c700 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -168,6 +168,8 @@ static tree lookup_tag PROTO((enum tree_code, tree,
struct binding_level *, int));
static void set_identifier_type_value_with_scope
PROTO((tree, tree, struct binding_level *));
+static void set_identifier_local_value_with_scope
+ PROTO((tree, tree, struct binding_level *));
static void record_builtin_type PROTO((enum rid, char *, tree));
static void record_unknown_type PROTO((tree, char *));
static int member_function_or_else PROTO((tree, tree, char *));
@@ -2159,7 +2161,7 @@ set_identifier_type_value (id, type)
set_identifier_type_value_with_scope (id, type, inner_binding_level);
}
-void
+static void
set_identifier_local_value_with_scope (id, val, b)
tree id, val;
struct binding_level *b;
@@ -5083,7 +5085,8 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
TREE_TYPE (val));
}
- val = from_obj;
+ /* We don't change val to from_obj here because that breaks
+ implicit typename for destructor calls. */
}
if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 0c26086..d294497 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -59,6 +59,8 @@ static tree do_pop_exception PROTO((void));
static void process_start_catch_block PROTO((tree, tree));
static void process_start_catch_block_old PROTO((tree, tree));
static tree build_eh_type_type_ref PROTO((tree));
+static tree build_terminate_handler PROTO((void));
+static tree alloc_eh_object PROTO((tree));
#if 0
/* This is the startup, and finish stuff per exception table. */
@@ -556,7 +558,7 @@ push_eh_cleanup ()
/* Build up a call to terminate on the function obstack, for use as an
exception handler. */
-tree
+static tree
build_terminate_handler ()
{
int yes = suspend_momentary ();
@@ -1040,7 +1042,7 @@ end_anon_func ()
/* Return a pointer to a buffer for an exception object of type TYPE. */
-tree
+static tree
alloc_eh_object (type)
tree type;
{
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index ebd788a..bde0a29 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -131,6 +131,7 @@ static void add_conversions PROTO((tree));
static tree get_virtuals_named_this PROTO((tree));
static tree get_virtual_destructor PROTO((tree, int));
static int tree_has_any_destructor_p PROTO((tree, int));
+static int covariant_return_p PROTO((tree, tree));
static struct search_level *push_search_level
PROTO((struct stack_level *, struct obstack *));
static struct search_level *pop_search_level
@@ -2163,7 +2164,7 @@ tree_has_any_destructor_p (binfo, i)
Returns 1 if trivial covariance, 2 if non-trivial (requiring runtime
adjustment), or -1 if pedantically invalid covariance. */
-int
+static int
covariant_return_p (brettype, drettype)
tree brettype, drettype;
{