aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-09-20 18:28:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-09-20 18:28:36 +0000
commitfab701dab01ecbf5dfef464064f71bf3067d39db (patch)
treea7d06e4103082bf244051c3425dd788c92904498
parent155b14a87e5f8fbb3d6f63a69f521d92a4b40347 (diff)
downloadgcc-fab701dab01ecbf5dfef464064f71bf3067d39db.zip
gcc-fab701dab01ecbf5dfef464064f71bf3067d39db.tar.gz
gcc-fab701dab01ecbf5dfef464064f71bf3067d39db.tar.bz2
* tree.c (mark_local_for_remap_r): Handle CASE_LABELs.
From-SVN: r36553
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash23.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline14.C49
4 files changed, 56 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d71c9d7..eb1fa50 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 9b5e2be..a1d37c8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash23.C b/gcc/testsuite/g++.old-deja/g++.other/crash23.C
index afe0920..75bab60 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash23.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash23.C
@@ -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
index 0000000..7a50fab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline14.C
@@ -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;
+ }