]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/27650 (internal compiler error while compiling Gecode)
authorDanny Smith <dannysmith@users.sourceforge.net>
Wed, 20 Sep 2006 23:27:05 +0000 (23:27 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Wed, 20 Sep 2006 23:27:05 +0000 (23:27 +0000)
PR target/27650
* class.c (check_for_override): Remove dllimport from virtual
methods.

From-SVN: r117096

gcc/cp/ChangeLog
gcc/cp/class.c

index a5d403a600f3d684c3f99237166c341149122594..fed109fe50e6821f6a8462b7c009febd2c241deb 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-20  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       PR target/27650
+       * class.c (check_for_override): Remove dllimport from virtual
+       methods.
+
 2006-09-18  Steven Bosscher  <steven@gcc.gnu.org>
 
        PR c++/29087
index 7361b5a1ba9b9d383ec80829b6e5bcee0fb5dad9..fa11606f2d1c4427bd178e41a2f50c60fe7f0de8 100644 (file)
@@ -2342,6 +2342,16 @@ check_for_override (tree decl, tree ctype)
       if (!DECL_VINDEX (decl))
        DECL_VINDEX (decl) = error_mark_node;
       IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)) = 1;
+      if (DECL_DLLIMPORT_P (decl))
+       {
+         /* When we handled the dllimport attribute we may not have known
+            that this function is virtual   We can't use dllimport
+            semantics for a virtual method because we need to initialize
+            the vtable entry with a constant address.  */
+         DECL_DLLIMPORT_P (decl) = 0;
+         DECL_ATTRIBUTES (decl)
+           = remove_attribute ("dllimport", DECL_ATTRIBUTES (decl));
+       }
     }
 }