From 71ad4a16b65f21156bc89064d51088f065bbe020 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 12 Sep 2000 15:36:23 +0000 Subject: 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 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 1 + gcc/testsuite/g++.old-deja/g++.other/inline13.C | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/inline13.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0df451c..e5db96e 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 78a2f76..5653a38 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 0000000..a24a74e --- /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(); +} -- cgit v1.1