Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.15.0-beta2
-
None
-
Kubuntu 20.10 x86-64
Description
QtCreator displays structure sizes in tooltips when you hover mouse over the structure name in the structure definition. Those sizes are incorrect in a few contexts.
For example, in these definitions:
#include <cstdint>
struct A
{
std::uint64_t a;
std::uint8_t b;
};
struct B :
public A
{
std::uint8_t c;
};
hovering mouse over A shows its size is 12 bytes, and B is 16 bytes. gcc shows 16 and 24, respectively (https://gcc.godbolt.org/z/YzGf5EeGn).
Another example:
#include <cstdint>
struct A
{
std::uint8_t b;
virtual ~A();
};
struct B :
public A
{
std::uint8_t c;
};
Here QtCreator shows 8 bytes for each struct while gcc shows 16 (https://gcc.godbolt.org/z/Wvnz6xd6f).
It looks like the struct sizes are calculated for 32-bit x86 target, even though the actual build target is x86-64.