cp-tree.h (struct language_function): Remove static_labelno.
authorMark Mitchell <mark@codesourcery.com>
Mon, 4 Oct 1999 09:33:31 +0000 (09:33 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 4 Oct 1999 09:33:31 +0000 (09:33 +0000)
* 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
gcc/cp/cp-tree.h
gcc/cp/method.c
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.pt/local7.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/memtemp92.C [new file with mode: 0644]

index 03d2b1a28091d7338ad7777d4e34d9370987aa5b..ff9137b5de5fa7f033c54b25d480d92c2c57467c 100644 (file)
@@ -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.
index f1134afff6352155b3e7443c7fb56d269044c4b1..5d65abfcf6461f41bbe4ed6f108562052e73df3d 100644 (file)
@@ -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.  */
index 8cb4eb3082adf860e97cb07a00d56e28b7f92ec4..4ddcf7d7589ee10e5144072684c66038437bfd43 100644 (file)
@@ -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;
 
index 9586ec2fb78ee37df786359443e53b22b934e41b..b4b9ba9b5306333981dc797876d77fdd8c43452c 100644 (file)
@@ -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 (file)
index 0000000..faee1a9
--- /dev/null
@@ -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 (file)
index 0000000..899e7f3
--- /dev/null
@@ -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;
+}