* tree.c (mark_local_for_remap_r): Handle CASE_LABELs.
authorMark Mitchell <mark@codesourcery.com>
Wed, 20 Sep 2000 18:28:36 +0000 (18:28 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 20 Sep 2000 18:28:36 +0000 (18:28 +0000)
From-SVN: r36553

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/g++.old-deja/g++.other/crash23.C
gcc/testsuite/g++.old-deja/g++.other/inline14.C [new file with mode: 0644]

index d71c9d78789be8766b15272ac0ddf0893e7565e8..eb1fa50a3afa7ae64b5672587b18107e1d003866 100644 (file)
@@ -1,3 +1,7 @@
+2000-09-20  Mark Mitchell  <mark@codesourcery.com>
+
+       * tree.c (mark_local_for_remap_r): Handle CASE_LABELs.
+
 2000-09-20  Hans-Peter Nilsson  <hp@axis.com>
 
        * except.c: Delete #if 0:d EXCEPTION_SECTION_ASM_OP-default and
index 9b5e2be87f2f593f35fe44141a392931b8fef4cb..a1d37c86698650f05ed555b5f69aa3457e49996f 100644 (file)
@@ -2465,6 +2465,8 @@ mark_local_for_remap_r (tp, walk_subtrees, data)
   else if (TREE_CODE (t) == TARGET_EXPR
           && nonstatic_local_decl_p (TREE_OPERAND (t, 0)))
     decl = TREE_OPERAND (t, 0);
+  else if (TREE_CODE (t) == CASE_LABEL)
+    decl = CASE_LABEL_DECL (t);
   else
     decl = NULL_TREE;
 
index afe09204024720e469e73edf2805c76c1554dfd3..75bab602650412381bd39f565e647cfe0e3aefd0 100644 (file)
@@ -3,5 +3,5 @@
 
 class T;
 inline void operator<(T&, T&) { }
-inline void operator<(T&, T&) { }
+inline void operator<(T&, T&) { } // ERROR - duplicate definition
 
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline14.C b/gcc/testsuite/g++.old-deja/g++.other/inline14.C
new file mode 100644 (file)
index 0000000..7a50fab
--- /dev/null
@@ -0,0 +1,49 @@
+// Build don't link:
+// Origin: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+#include <iostream>
+
+struct IDENT
+    {
+    enum TYPE { Variable, Constant } type;
+
+    ostream& printTo(ostream& out) const
+       {
+       switch (type)
+           {
+           case Variable:
+               out << '_';
+               break;
+           default:
+               break;
+           }
+       return out;
+       }
+    };
+
+
+template <class T>
+struct TC
+    {
+    IDENT i;
+
+    const IDENT& getIdent() const
+        {
+       return i;
+       }
+    };
+
+template <class T>
+inline ostream& operator<< (ostream& out, const TC<T> &c)
+    {
+    c.getIdent().printTo(out);
+    return out;
+    }
+
+void foo(const TC<IDENT> &c)
+    {
+    cerr << c 
+         << ": " // This line is crucial!
+         << c
+         << endl;
+    }