From 39c76b4f031db5f1cb51d79016305f1a9b35d80e Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 4 Oct 1999 09:33:31 +0000 Subject: [PATCH] cp-tree.h (struct language_function): Remove static_labelno. * cp-tree.h (struct language_function): Remove static_labelno. (static_labelno): Remove macro. * method.c (build_overload_nested_name): Make static_labelno static here. * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, to decide whether or not a function is defined. From-SVN: r29801 --- gcc/cp/ChangeLog | 8 +++++++ gcc/cp/cp-tree.h | 3 --- gcc/cp/method.c | 2 ++ gcc/cp/pt.c | 2 +- gcc/testsuite/g++.old-deja/g++.pt/local7.C | 24 +++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C | 30 +++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/local7.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 03d2b1a..ff9137b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,13 @@ 1999-10-04 Mark Mitchell + * cp-tree.h (struct language_function): Remove static_labelno. + (static_labelno): Remove macro. + * method.c (build_overload_nested_name): Make static_labelno + static here. + + * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, + to decide whether or not a function is defined. + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for situations where make_node will do it automatically. * decl.c (grok_reference_init): Likewise. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f1134af..5d65abf 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -674,7 +674,6 @@ struct language_function int returns_null; int parms_stored; int temp_name_counter; - int static_labelno; int in_function_try_handler; int x_expanding_p; int name_declared; @@ -794,8 +793,6 @@ struct language_function #define temp_name_counter cp_function_chain->temp_name_counter -#define static_labelno cp_function_chain->static_labelno - /* Non-zero if we should generate RTL for functions that we process. When this is zero, we just accumulate tree structure, without interacting with the back end. */ diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 8cb4eb3..4ddcf7d 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -501,6 +501,8 @@ build_overload_nested_name (decl) if (TREE_CODE (decl) == FUNCTION_DECL) { + static int static_labelno; + tree name = DECL_ASSEMBLER_NAME (decl); char *label; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9586ec2..b4b9ba9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9555,7 +9555,7 @@ instantiate_decl (d) code_pattern = DECL_TEMPLATE_RESULT (td); if (TREE_CODE (d) == FUNCTION_DECL) - pattern_defined = (DECL_INITIAL (code_pattern) != NULL_TREE); + pattern_defined = (DECL_SAVED_TREE (code_pattern) != NULL_TREE); else pattern_defined = ! DECL_IN_AGGR_P (code_pattern); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local7.C b/gcc/testsuite/g++.old-deja/g++.pt/local7.C new file mode 100644 index 0000000..faee1a9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/local7.C @@ -0,0 +1,24 @@ +// Build don't link: +// Special g++ Options: -fsquangle + +template inline STRUCT * +setback(MEMBER *bp, MEMBER STRUCT::*offset) +{ + if(!bp) return 0; + union { int i; MEMBER STRUCT::*of; } u; + u.of = offset; + return (STRUCT *) ((int) bp - u.i); +} + + +struct S +{ + int i; +}; + +int main() +{ + S s; + + S* sp = setback (&s.i, &S::i); +} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C new file mode 100644 index 0000000..899e7f3 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C @@ -0,0 +1,30 @@ +// Build don't link: +// Origin: "Adam J. Richter" + +template +class theme_map { +}; + +class QWidget { +protected: + virtual void *harmony_get_list_for_signal(const char *) const; + +public: + static theme_map ContentsThemes; + +protected: + virtual void updateDrawingObjects (void) + { + update_dro (QWidget::ContentsThemes); + } + + template + void update_dro (theme_map& themes) + { + } +}; + +void *QWidget::harmony_get_list_for_signal(const char *sig) const +{ + return 0; +} -- 2.7.4