The story’s score and claims

Comments on No. 20 of 124 · Train IT · edition of Tuesday 27 October 2026

A hardcoded C++ standard broke the One Definition Rule

Summary

A consulting customer's random crashes came from a dependency whose CMakeLists.txt hardcoded C++14 while Conan built everything else as C++17. In the author's reproducer, variant-lite resolves to different types in each half, GCC 15 builds and links without warnings, and the program segfaults because the Itanium ABI passes the two variants differently. GCC's LTO -Wodr catches it only when both sides use LTO. The suggested fix is target_compile_features plus a Conan check_min_cppstd; the reproducer results are the author's own.

Comments

Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules