ABI that depends on C++ standard of downstream compilation unit in latest master? #1502
Open
2 tasks done
Labels
type: bug
Indicates an unexpected problem or unintended behavior
By inspecting the DART source code, I noticed that the
dart::common::optional
class introduced in #1416 changes its ABI depending on the compilation flags of the compilation unit in which it is compiled. This may mean that one compilation unit creates a function that takes adart::common::optional
class with C++14, and another compilation unit uses this function in C++17, leading to a runtime error.This kind of practice are allowed in some libraries (abseil, for example) that are meant to be compiled in enviroments where all the source code are compiled with exactly the same compilation option, but that is typically not the case for projects like DART that are used from binary packages compiled for Linux distributions.
Bug Report
Environment
Expected Behavior
I would expect that, once configured and compiled, the ABI of the struct and classes present in DART headers would not change based on the compilation option of downstream projects.
Current Behavior
I did not any extensive test, but by inspection of the
dart::common::optional
class it seems that its ABI changes depending on the compilation option of downstream projects.The text was updated successfully, but these errors were encountered: