aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1997-10-07 03:50:21 -0400
committerJason Merrill <jason@gcc.gnu.org>1997-10-07 03:50:21 -0400
commitc32381b1878298d0d3e5f6625ed30b9d7b523fef (patch)
treeded2a3f8c24b4d19b9676b97beaa072fbcf41cb8 /gcc
parent45f22fa2551c0002d82ff11384921418dc67711c (diff)
downloadgcc-c32381b1878298d0d3e5f6625ed30b9d7b523fef.zip
gcc-c32381b1878298d0d3e5f6625ed30b9d7b523fef.tar.gz
gcc-c32381b1878298d0d3e5f6625ed30b9d7b523fef.tar.bz2
decl.c (duplicate_decls): Don't warn about template instances.
* decl.c (duplicate_decls): Don't warn about template instances. * typeck.c (mark_addressable): Lose ancient code that unsets DECL_EXTERNAL. * pt.c (do_decl_instantiation): Lose support for instantiating non-templates. * call.c (build_new_function_call): Fix handling of null explicit template args. (build_new_method_call): Likewise. Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net> * method.c (build_underscore_int): Fix typo. From-SVN: r15851
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog20
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/pt.c14
-rw-r--r--gcc/cp/typeck.c9
6 files changed, 32 insertions, 26 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fbb7cc1..1fdd092 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,21 @@
+Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (duplicate_decls): Don't warn about template instances.
+
+ * typeck.c (mark_addressable): Lose ancient code that unsets
+ DECL_EXTERNAL.
+
+ * pt.c (do_decl_instantiation): Lose support for instantiating
+ non-templates.
+
+ * call.c (build_new_function_call): Fix handling of null explicit
+ template args.
+ (build_new_method_call): Likewise.
+
+Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
+
+ * method.c (build_underscore_int): Fix typo.
+
1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
* tree.c (print_lang_statistics): #if 0 call to
@@ -5,6 +23,8 @@
Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * decl2.c (finish_file): Move dump_tree_statistics to end.
+
* pt.c (instantiate_decl): Look for the original template.
(tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
of member templates.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e232a38..dc31002 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4484,11 +4484,13 @@ build_new_function_call (fn, args, obj)
{
struct z_candidate *candidates = 0, *cand;
tree explicit_targs = NULL_TREE;
+ int template_only = 0;
if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
{
explicit_targs = TREE_OPERAND (fn, 1);
fn = TREE_OPERAND (fn, 0);
+ template_only = 1;
}
if (obj == NULL_TREE && really_overloaded_fn (fn))
@@ -4510,7 +4512,7 @@ build_new_function_call (fn, args, obj)
(candidates, t, explicit_targs, args, NULL_TREE,
LOOKUP_NORMAL);
}
- else if (explicit_targs == NULL_TREE)
+ else if (! template_only)
candidates = add_function_candidate
(candidates, t, args, LOOKUP_NORMAL);
}
@@ -5466,11 +5468,13 @@ build_new_method_call (instance, name, args, basetype_path, flags)
tree pretty_name;
tree user_args = args;
tree templates = NULL_TREE;
+ int template_only = 0;
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
explicit_targs = TREE_OPERAND (name, 1);
name = TREE_OPERAND (name, 0);
+ template_only = 1;
}
/* If there is an extra argument for controlling virtual bases,
@@ -5574,7 +5578,7 @@ build_new_method_call (instance, name, args, basetype_path, flags)
TREE_TYPE (name),
LOOKUP_NORMAL);
}
- else if (explicit_targs == NULL_TREE)
+ else if (! template_only)
candidates = add_function_candidate (candidates, t,
this_arglist, flags);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e9b8de3..57455d2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2623,8 +2623,9 @@ duplicate_decls (newdecl, olddecl)
}
}
- if (TREE_CODE (olddecl) == FUNCTION_DECL
- && ! DECL_USE_TEMPLATE (olddecl))
+ if (DECL_USE_TEMPLATE (olddecl))
+ ;
+ else if (TREE_CODE (olddecl) == FUNCTION_DECL)
{
tree t1 = TYPE_ARG_TYPES (TREE_TYPE (olddecl));
tree t2 = TYPE_ARG_TYPES (TREE_TYPE (newdecl));
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 69d1670e..3b70743 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -424,7 +424,7 @@ build_underscore_int (int i)
OB_PUTC ('_');
icat (i);
if (i > 9)
- OB_PUTS ('_');
+ OB_PUTC ('_');
}
/* Encoding for an INTEGER_CST value. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 95109cf..cfa5164 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4226,24 +4226,14 @@ do_decl_instantiation (declspecs, declarator, storage)
fn = TREE_VALUE (fn);
for (; fn; fn = DECL_CHAIN (fn))
- if (decls_match (fn, decl) && DECL_DEFER_OUTPUT (fn))
- {
- result = fn;
- break;
- }
- else if (TREE_CODE (fn) == TEMPLATE_DECL)
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
templates = decl_tree_cons (NULL_TREE, fn, templates);
}
}
else if (name = DECL_NAME (decl), fn = IDENTIFIER_GLOBAL_VALUE (name), fn)
{
for (fn = get_first_fn (fn); fn; fn = DECL_CHAIN (fn))
- if (decls_match (fn, decl) && DECL_DEFER_OUTPUT (fn))
- {
- result = fn;
- break;
- }
- else if (TREE_CODE (fn) == TEMPLATE_DECL)
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
templates = decl_tree_cons (NULL_TREE, fn, templates);
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 971cab4..797cd3d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4772,15 +4772,6 @@ mark_addressable (exp)
be non-zero in the case of processing a default function.
The second may be non-zero in the case of a template function. */
x = DECL_MAIN_VARIANT (x);
- if ((DECL_THIS_INLINE (x) || DECL_PENDING_INLINE_INFO (x))
- && (DECL_CONTEXT (x) == NULL_TREE
- || TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (x))) != 't'
- || ! CLASSTYPE_INTERFACE_ONLY (DECL_CONTEXT (x))))
- {
- mark_inline_for_output (x);
- if (x == current_function_decl)
- DECL_EXTERNAL (x) = 0;
- }
if (DECL_TEMPLATE_INFO (x) && !DECL_TEMPLATE_SPECIALIZATION (x))
mark_used (x);
TREE_ADDRESSABLE (x) = 1;