From: Mark Mitchell Date: Wed, 20 Sep 2000 18:28:36 +0000 (+0000) Subject: * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fab701dab01ecbf5dfef464064f71bf3067d39db;p=gcc.git * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. From-SVN: r36553 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d71c9d78789..eb1fa50a3af 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-09-20 Mark Mitchell + + * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. + 2000-09-20 Hans-Peter Nilsson * 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 9b5e2be87f2..a1d37c86698 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 afe09204024..75bab602650 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 00000000000..7a50fab0a5d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/inline14.C @@ -0,0 +1,49 @@ +// Build don't link: +// Origin: Gerald Pfeifer + +#include + +struct IDENT + { + enum TYPE { Variable, Constant } type; + + ostream& printTo(ostream& out) const + { + switch (type) + { + case Variable: + out << '_'; + break; + default: + break; + } + return out; + } + }; + + +template +struct TC + { + IDENT i; + + const IDENT& getIdent() const + { + return i; + } + }; + +template +inline ostream& operator<< (ostream& out, const TC &c) + { + c.getIdent().printTo(out); + return out; + } + +void foo(const TC &c) + { + cerr << c + << ": " // This line is crucial! + << c + << endl; + }