[Bug target/36654] [4.2 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes

2009-03-31 Thread jsm28 at gcc dot gnu dot org


--- Comment #15 from jsm28 at gcc dot gnu dot org  2009-03-31 15:42 ---
Closing 4.2 branch, fixed for 4.3.3 and 4.4.  If there are problems with
the fix, a separate issue has been / should be filed for those.


-- 

jsm28 at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Known to fail|4.2.4 4.3.0 4.3.1 4.3.2 |4.2.4 4.3.0 4.3.1 4.3.2
   ||4.2.5
 Resolution||FIXED
   Target Milestone|4.2.5   |4.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654



[Bug target/36654] [4.2 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes

2009-03-29 Thread tdragon at tdragon dot net


--- Comment #14 from tdragon at tdragon dot net  2009-03-29 15:30 ---
I have just filed PR39578, the cause of which may be related to this PR or its
fix.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654



[Bug target/36654] [4.2 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes

2009-03-28 Thread dannysmith at users dot sourceforge dot net


--- Comment #13 from dannysmith at users dot sourceforge dot net  
2009-03-28 07:24 ---
(In reply to comment #12)
 Both the dg-error clauses now fail; previously (4.3.2), only the second one
 failed.  Reverting the patch causes the first dg-error (line 21) to pass again
 by restoring the error message
 
 /gnu/gcc/release/gcc4-4.3.3-1/src/gcc-4.3.3/gcc/testsuite/g++.dg/ext/dllimport7.
 C:21: error: definition of static data member 'Bar::three' of dllimport'd 
 class
 
 I'm not sure why that should be a problem in the first place, so I don't know
 if the underlying issue is now fixed and not an error any more.  Anybody?
 

IMO, the hard error should occur.
The native MS compiler emits a similar error message.
Allowing a static data member to be defined in more than one place is a bad
thing.  It most be defined in the dll if the class is defined there and, in the
situation the testcase is testing will be defined again in the exe or dll that
uses the dll.   


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654



[Bug target/36654] [4.2 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes

2009-03-25 Thread dave dot korn dot cygwin at gmail dot com


--- Comment #12 from dave dot korn dot cygwin at gmail dot com  2009-03-25 
08:03 ---
Hi all.

This patch caused g++.dg/ext/dllimport7.C to regress (in one subtest) between
4.3.2 and 4.3.3 on Cygwin, although it could be that the testcase is out of
date.

// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }

//  Report errors on definition of dllimport'd static data member . 


struct Baz
{
  Baz(int a_ =0) : a(a_) {} 
  int a;
};

class  __declspec(dllimport) Bar
{
  public:
enum {one = 1};
static const int two = 2;
static const int three;
static const Baz null_baz;
};

const int Bar::three = 3;   //  { dg-warning redeclared without dllimport
}
//  { dg-error definition of static data C++ specific error { target
i?86-*-cygwin* i?86-*-mingw* } 21 }

const Baz Bar::null_baz;//  { dg-warning redeclared without dllimport
}
//  { dg-error definition of static data C++ specific error { target
i?86-*-cygwin* i?86-*-mingw* }  24 }



int foo()
{
  Bar foobar;
  const int* baz = Bar::two; 
  int a = foobar.two;
  int b = foobar.three;
  int c = foobar.null_baz.a;
  return (a + b + c + *baz);
}



Both the dg-error clauses now fail; previously (4.3.2), only the second one
failed.  Reverting the patch causes the first dg-error (line 21) to pass again
by restoring the error message

/gnu/gcc/release/gcc4-4.3.3-1/src/gcc-4.3.3/gcc/testsuite/g++.dg/ext/dllimport7.
C:21: error: definition of static data member 'Bar::three' of dllimport'd class

I'm not sure why that should be a problem in the first place, so I don't know
if the underlying issue is now fixed and not an error any more.  Anybody?


-- 

dave dot korn dot cygwin at gmail dot com changed:

   What|Removed |Added

 CC||dave dot korn dot cygwin at
   ||gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654