This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug in egcs-20000524



Fixed with this patch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-05-26  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (grokclassfn): Set DECL_LANGUAGE here.
	* method.c (implicitly_declare_fn): Not here.

Index: testsuite/g++.old-deja/g++.other/externC2.C
===================================================================
RCS file: externC2.C
diff -N externC2.C
*** /dev/null	Tue May  5 13:32:27 1998
--- externC2.C	Fri May 26 09:49:55 2000
***************
*** 0 ****
--- 1,16 ----
+ // Build don't link:
+ // Origin: Boris Zentner <boris@m2b.de>
+ 
+ extern "C"
+ {
+ struct xx
+ {
+   int x;
+   xx();
+ };
+ 
+ xx::xx()
+ {
+   x = 0;
+ }
+ }
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.353
diff -c -p -r1.353 decl2.c
*** decl2.c	2000/05/24 22:56:53	1.353
--- decl2.c	2000/05/26 16:47:58
*************** grokclassfn (ctype, function, flags, qua
*** 1009,1014 ****
--- 1009,1018 ----
    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: method.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/method.c,v
retrieving revision 1.157
diff -c -p -r1.157 method.c
*** method.c	2000/05/22 22:52:32	1.157
--- method.c	2000/05/26 16:48:00
*************** implicitly_declare_fn (kind, type, const
*** 2581,2589 ****
    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;
--- 2581,2586 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]