This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/42158] structure alignment for derived class is wrong in some cases
- From: "info at hex-rays dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2009 11:02:26 -0000
- Subject: [Bug libstdc++/42158] structure alignment for derived class is wrong in some cases
- References: <bug-42158-18480@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from info at hex-rays dot com 2009-11-24 11:02 -------
What is embarrassing is that the compiler does not issue at least a warning and
changes the alignment depending on some very obscure factor. I understand why
it happens but really do not like it.
If I add one more line to myadd.cpp, after the include lines:
std::set<int> my_intset2;
the compiler will generate another copy of the set<int> ctor, but it will be
different from the one in gcc_align_bug.o
You could at least check the both ctors are identical at the linking time and
issue a warning. On the other hand, now I realized that such a bug should have
been filled very long ago...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42158