From: Mark Mitchell Date: Tue, 12 Sep 2000 15:36:23 +0000 (+0000) Subject: decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT. X-Git-Tag: prereleases/libstdc++-2.92~4066 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71ad4a16b65f21156bc89064d51088f065bbe020;p=thirdparty%2Fgcc.git decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT. * decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT. From-SVN: r36365 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0df451c1d6aa..e5db96e2b6b0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-09-12 Mark Mitchell + + * decl.c (finish_case_label): Given the LABEL_DECL a + DECL_CONTEXT. + 2000-09-12 Gabriel Dos Reis * error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 78a2f760fdf7..5653a38b7fc4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5226,6 +5226,7 @@ finish_case_label (low_value, high_value) } label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); + DECL_CONTEXT (label) = current_function_decl; if (processing_template_decl) { diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline13.C b/gcc/testsuite/g++.old-deja/g++.other/inline13.C new file mode 100644 index 000000000000..a24a74ef7642 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/inline13.C @@ -0,0 +1,18 @@ +// Build don't link: +// Origin: Alexandre Oliva + +struct foo { + inline void bar(); + foo(); +}; + +inline void foo::bar() { + switch (0) { + case 0: + break; + } +} + +foo::foo() { + bar(); +}