Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't predeclare a struct as a class (#114)
Holy moly this took a long time to debug. MSVC gives absolutely zero warnings about if a struct/class is predeclared as one or the other, during compilation. However, linking also needs to happen. And as it turns out, [whether a thing is a class or struct is part of the MSVC name mangling spec](https://en.wikiversity.org/wiki/Visual_C%2B%2B_name_mangling). Hence, we'd end up with e.g. this function (which references `SymbolInfo`) as being defined in it's object file as the following symbol: > `lookupSymbolsByLocation@SymbolTable@textplan@substrait@io@@qeba?AV?$vector@PEBUSymbolInfo@textplan@substrait@io@@v?$allocator@PEBUSymbolInfo@textplan@substrait@io@@@std@@@std@@AEBVLocation@234@@Z` However, things which reference `SymbolInfo`, but which may have pulled in the incorrect predeclaration prior, will reference it as an incorrect symbol: > `lookupSymbolsByLocation@SymbolTable@textplan@substrait@io@@qeba?AV?$vector@PEBVSymbolInfo@textplan@substrait@io@@v?$allocator@PEBVSymbolInfo@textplan@substrait@io@@@std@@@std@@AEBVLocation@234@@z ...` e.g. notice the difference between `PEBUSymbolInfo` and `PEBVSymbolInfo`. Enqueue strange linking issues galore.
- Loading branch information