decl.c (finish_case_label): Given the LABEL_DECL a DECL_CONTEXT.
authorMark Mitchell <mark@codesourcery.com>
Tue, 12 Sep 2000 15:36:23 +0000 (15:36 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 12 Sep 2000 15:36:23 +0000 (15:36 +0000)
* decl.c (finish_case_label): Given the LABEL_DECL a
DECL_CONTEXT.

From-SVN: r36365

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

index 0df451c1d6aa64ead0d55b2f96e913ef13832e8c..e5db96e2b6b032c8349980d5e89888225fe3c2ad 100644 (file)
@@ -1,3 +1,8 @@
+2000-09-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (finish_case_label): Given the LABEL_DECL a
+       DECL_CONTEXT.
+
 2000-09-12  Gabriel Dos Reis  <gdr@codesourcery.com>
 
        * error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE,
index 78a2f760fdf76a04f40146fa1e48ca04b6981c57..5653a38b7fc45388bc7b9bbc0063e39d65aca781 100644 (file)
@@ -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 (file)
index 0000000..a24a74e
--- /dev/null
@@ -0,0 +1,18 @@
+// Build don't link:
+// Origin: Alexandre Oliva <aoliva@cygnus.com>
+
+struct foo {
+  inline void bar();
+  foo();
+};
+
+inline void foo::bar() {
+  switch (0) {
+  case 0:
+    break;
+  }
+}
+
+foo::foo() {
+  bar();
+}