diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 97c6763e720..6a592a46f90 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +2000-07-17 Jason Merrill + + * typeck.c (mark_addressable): Never set TREE_USED. + * call.c (build_call): Don't abort on calls to library functions + that have been declared normally. + + * typeck.c (build_binary_op): Fix grammar in warning. + + * exception.cc (__eh_free): Fix prototype. + + * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR. + + * decl.c (pushdecl): Handle seeing an OVERLOAD in + IDENTIFIER_NAMESPACE_VALUE. + 2000-07-14 Zack Weinberg * .cvsignore: parse.h and parse.c have no cp- prefix. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 48ce6fb76a9..4a68f57d9d9 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -397,8 +397,11 @@ build_call (function, parms) if (decl && ! TREE_USED (decl)) { - /* We invoke build_call directly for several library functions. */ - if (DECL_ARTIFICIAL (decl)) + /* We invoke build_call directly for several library functions. + These may have been declared normally if we're building libgcc, + so we can't just check DECL_ARTIFICIAL. */ + if (DECL_ARTIFICIAL (decl) + || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2)) mark_used (decl); else my_friendly_abort (990125); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1f49ae637c5..f8c5ff29708 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4019,15 +4019,12 @@ pushdecl (x) { tree decl; - if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE - && IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node - && (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name)) - || TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name)))) - decl = IDENTIFIER_NAMESPACE_VALUE (name); - else - decl = NULL_TREE; + decl = IDENTIFIER_NAMESPACE_VALUE (name); + if (decl && TREE_CODE (decl) == OVERLOAD) + decl = OVL_FUNCTION (decl); - if (decl + if (decl && decl != error_mark_node + && (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl)) /* If different sort of thing, we already gave an error. */ && TREE_CODE (decl) == TREE_CODE (x) && !same_type_p (TREE_TYPE (x), TREE_TYPE (decl))) diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 600cfceffa7..64a09c0be44 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4310,6 +4310,8 @@ finish_decl_parsing (decl) /* For attribute handling. */ TREE_VALUE (decl) = finish_decl_parsing (TREE_VALUE (decl)); return decl; + case TEMPLATE_ID_EXPR: + return decl; default: my_friendly_abort (5); return NULL_TREE; diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc index 1ffd7624a09..886915c823b 100644 --- a/gcc/cp/exception.cc +++ b/gcc/cp/exception.cc @@ -120,7 +120,7 @@ extern "C" cp_eh_info **__get_eh_info (); // actually void ** /* Exception allocate and free, defined in libgcc2. */ extern "C" void *__eh_alloc(size_t); -extern "C" void __eh_free(); +extern "C" void __eh_free(void *); /* Is P the type_info node for a pointer of some kind? */ diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a12ebe9aac0..c85e3d16f96 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3963,7 +3963,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) signed_type (result_type))))) /* OK */; else - warning ("comparison between a signed and an unsigned integer expressions"); + warning ("comparison between signed and unsigned integer expressions"); /* Warn if two unsigned values are being compared in a size larger than their original size, and one (and only one) is the @@ -4969,21 +4969,12 @@ mark_addressable (exp) cp_warning ("address requested for `%D', which is declared `register'", x); TREE_ADDRESSABLE (x) = 1; - TREE_USED (x) = 1; if (cfun && expanding_p) put_var_into_stack (x); return 1; case FUNCTION_DECL: - /* We have to test both conditions here. The first may be - non-zero in the case of processing a default function. The - second may be non-zero in the case of a template function. */ - if (DECL_LANG_SPECIFIC (x) - && DECL_TEMPLATE_INFO (x) - && !DECL_TEMPLATE_SPECIALIZATION (x)) - mark_used (x); TREE_ADDRESSABLE (x) = 1; - TREE_USED (x) = 1; TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1; return 1;