I have a 3rd party lib called TheLib and my lib called MyLib
TheLib is compiled first with a Struct contained in a header file called variantmap.h. This header contains 2 inline functions:
struct VariantMap {
string name;
map<string, Variant> children;
bool isArray;
VariantMap(VariantMap & variantMap) {
name = variantMap.name;
children = variantMap.children;
isArray = variantMap.isArray;
}
VariantMap() {
isArray = false;
}
};
MyLib also compiles with the aforementioned header.
When I compile both libs with -O2 (optimization level) MyLib crashes, but if I compile MyLib with -O2 but without inline functions (i.e. -fno-default-inline), it does not???
The crash seems to occur on the assignment of the string name according to gdb?