aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-04 09:33:31 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-04 09:33:31 +0000
commit39c76b4f031db5f1cb51d79016305f1a9b35d80e (patch)
tree0f7221485b712643cb9f33f7ed00ed8a39541a30 /gcc
parentb3a798924e62d98a2a177db14c8cceb8e09781f9 (diff)
downloadgcc-39c76b4f031db5f1cb51d79016305f1a9b35d80e.zip
gcc-39c76b4f031db5f1cb51d79016305f1a9b35d80e.tar.gz
gcc-39c76b4f031db5f1cb51d79016305f1a9b35d80e.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-tree.h3
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/local7.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C30
6 files changed, 65 insertions, 4 deletions
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 <mark@codesourcery.com>
+ * 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 <class STRUCT, class MEMBER> 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" <adam@yggdrasil.com>
+
+template <class Style, class Base>
+class theme_map {
+};
+
+class QWidget {
+protected:
+ virtual void *harmony_get_list_for_signal(const char *) const;
+
+public:
+ static theme_map<int, QWidget> ContentsThemes;
+
+protected:
+ virtual void updateDrawingObjects (void)
+ {
+ update_dro (QWidget::ContentsThemes);
+ }
+
+ template <class S, class B>
+ void update_dro (theme_map<S, B>& themes)
+ {
+ }
+};
+
+void *QWidget::harmony_get_list_for_signal(const char *sig) const
+{
+ return 0;
+}