]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl2.c (grokclassfn): Set DECL_LANGUAGE here.
authorMark Mitchell <mark@codesourcery.com>
Fri, 26 May 2000 16:54:18 +0000 (16:54 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 26 May 2000 16:54:18 +0000 (16:54 +0000)
* decl2.c (grokclassfn): Set DECL_LANGUAGE here.
* method.c (implicitly_declare_fn): Not here.

From-SVN: r34194

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

index 83224d8daf69c300535857a18b575a6af115a5b9..1bccc360298018872bfc04942144d2079fb1c16e 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-26  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl2.c (grokclassfn): Set DECL_LANGUAGE here.
+       * method.c (implicitly_declare_fn): Not here.
+
 2000-05-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ...
index 315e3c86e7b43018b425e4e030ee86c1701f1176..11250e7a02f245c2210ac2a4c2d4f81ba5bbdd9d 100644 (file)
@@ -1034,6 +1034,10 @@ grokclassfn (ctype, function, flags, quals)
   tree fn_name = DECL_NAME (function);
   int this_quals = TYPE_UNQUALIFIED;
 
+  /* Even within an `extern "C"' block, members get C++ linkage.  See
+     [dcl.link] for details.  */
+  DECL_LANGUAGE (function) = lang_cplusplus;
+
   if (fn_name == NULL_TREE)
     {
       error ("name missing for member function");
index 53b51536bb94cde1c80bd1cb2ad4adbfd89ed1cd..6d34795fe9aa4f657af9a6779b7553f04dcb7724 100644 (file)
@@ -2581,9 +2581,6 @@ implicitly_declare_fn (kind, type, const_p)
   DECL_NOT_REALLY_EXTERN (fn) = 1;
   DECL_THIS_INLINE (fn) = 1;
   DECL_INLINE (fn) = 1;
-  /* Even within an `extern "C"' block, members get C++ linkage.  See
-     [dcl.link] for details.  */
-  DECL_LANGUAGE (fn) = lang_cplusplus;
   defer_fn (fn);
   
   return fn;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC2.C b/gcc/testsuite/g++.old-deja/g++.other/externC2.C
new file mode 100644 (file)
index 0000000..86d3736
--- /dev/null
@@ -0,0 +1,16 @@
+// Build don't link:
+// Origin: Boris Zentner <boris@m2b.de>
+
+extern "C"
+{
+struct xx
+{
+  int x;
+  xx();
+};
+
+xx::xx()
+{
+  x = 0;
+}
+}