Mixing class and struct
问题 I'm well aware of the difference between class and struct, however I'm struggling to authoritatively say if this is well defined: // declare foo (struct) struct foo; // define foo (class) class foo { }; // instance of foo, claiming to be a struct again! Well defined? struct foo bar; // mixing class and struct like this upsets at least one compiler (names are mangled differently) const foo& test() { return bar; } int main() { test(); return 0; } If this is undefined behaviour can someone point