public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27067]  New: Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions.
@ 2006-04-06 21:20 wszafran at users dot sourceforge dot net
  2006-04-16  5:14 ` [Bug target/27067] " dannysmith at users dot sourceforge dot net
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: wszafran at users dot sourceforge dot net @ 2006-04-06 21:20 UTC (permalink / raw)
  To: gcc-bugs

When the sample code snippet (below) is compiled, errors (below) occur.  This
issue breaks the compilation of wxWidgets' Media Library.  The same problem
occurs with the latest snapshot (20060331, used in the example below) of GCC
4.1.1, on both CygWin and MinGW.

The sample code (virt-test.ii):

# 1 "virt-test.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "virt-test.cpp"
struct top
{
  virtual ~top() {}
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
};

struct mid1 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun4() = 0;
};

struct mid2 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun5() = 0;
};

struct mid3 : public top
{
  virtual int __attribute__((__stdcall__)) fun1() = 0;
  virtual char __attribute__((__stdcall__)) fun2() = 0;
  virtual double __attribute__((__stdcall__)) fun3() = 0;
  virtual long __attribute__((__stdcall__)) fun6() = 0;
};

struct bottom : public mid1, public mid2, public mid3
{
  int __attribute__((__stdcall__)) fun1();
  char __attribute__((__stdcall__)) fun2();
  double __attribute__((__stdcall__)) fun3();

  long __attribute__((__stdcall__)) fun4()
  { return 345L; }

  long __attribute__((__stdcall__)) fun5()
  { return 456L; }

  long __attribute__((__stdcall__)) fun6()
  { return 567L; }
};

int __attribute__((__stdcall__)) bottom::fun1()
{ return 123; }

char __attribute__((__stdcall__)) bottom::fun2()
{ return 'a'; }

double __attribute__((__stdcall__)) bottom::fun3()
{ return 123.45; }

int main()
{
  bottom b;
  b.fun1();
  b.fun2();
  b.fun3();
  b.fun4();
  b.fun5();
  b.fun6();
}

The command line to compile:

mingw32-g++ -v -save-temps -Wall -Wextra -pedantic -o virt-test.exe virt-test
.cpp

And compiler output:

Using built-in specs.
Target: mingw32
Configured with:
/usr/local/src/gcc/build-cross/source/gcc-4.1-20060331//configure -v
--prefix=/usr/local/cross-mingw-4.1 --target=mingw32
--with-headers=/usr/local/cross-mingw-4.1/mingw32/include --with-gcc
--with-gnu-ld --with-gnu-as --enable-threads=win32 --disable-nls
--enable-languages=c,c++ --disable-win32-registry --disable-shared
--enable-sjlj-exceptions --enable-libstdcxx-allocator=pool --without-newlib
Thread model: win32
gcc version 4.1.1 20060331 (prerelease)
 /usr/local/cross-mingw-4.1/libexec/gcc/mingw32/4.1.1/cc1plus.exe -E -quiet -v
virt-test.cpp -Wall -Wextra -pedantic -fpch-preprocess -o virt-test.ii
ignoring nonexistent directory
"/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../mingw32/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1

/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1/mingw32

/usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../include/c++/4.1.1/backward
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/include
 /usr/local/cross-mingw-4.1/lib/gcc/mingw32/4.1.1/../../../../mingw32/include
End of search list.
 /usr/local/cross-mingw-4.1/libexec/gcc/mingw32/4.1.1/cc1plus.exe
-fpreprocessed virt-test.ii -quiet -dumpbase virt-test.cpp -auxbase virt-test
-Wall -Wextra -pedantic -version -o virt-test.s
GNU C++ version 4.1.1 20060331 (prerelease) (mingw32)
        compiled by GNU C version 3.4.4 (cygming special) (gdc 0.12, using dmd
0.125).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ce3135ac5ab9fb49e72d849828fbe7dc
virt-test.cpp:66: error: 'char *LTHUNK2()' aliased to undefined symbol
'_ZN6bottom4fun2Ev'
virt-test.cpp:66: error: 'char *LTHUNK3()' aliased to undefined symbol
'_ZN6bottom4fun2Ev'
virt-test.cpp:66: error: 'double *LTHUNK4()' aliased to undefined symbol
'_ZN6bottom4fun3Ev'
virt-test.cpp:66: error: 'double *LTHUNK5()' aliased to undefined symbol
'_ZN6bottom4fun3Ev'


-- 
           Summary: Compile errors with multiple inheritance where the
                    stdcall attribute is applied to virtual functions.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wszafran at users dot sourceforge dot net
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: mingw32


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-05-24 10:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06 21:20 [Bug c++/27067] New: Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions wszafran at users dot sourceforge dot net
2006-04-16  5:14 ` [Bug target/27067] " dannysmith at users dot sourceforge dot net
2006-04-18  3:10 ` wszafran at users dot sourceforge dot net
2006-04-20  1:59 ` wszafran at users dot sourceforge dot net
2006-05-17  2:36 ` pinskia at gcc dot gnu dot org
2006-05-21  8:08 ` pinskia at gcc dot gnu dot org
2006-11-13 19:56 ` thomas at reactsoft dot com
2007-01-21 18:42 ` Christoph_vW at reactos dot org
2007-04-05  7:05 ` aaronavay62 at aaronwl dot com
2007-05-08 14:08 ` angray at beeb dot net
2007-05-08 19:12 ` mark at codesourcery dot com
2007-05-08 21:02 ` angray at beeb dot net
2007-05-16 20:35 ` dannysmith at users dot sourceforge dot net
2007-05-24 10:12 ` dannysmith at gcc dot gnu dot org
2007-05-24 10:19 ` dannysmith at users dot sourceforge dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).