An ODR violations detector using LLVM/Clang's AST parser.
There appears to be a paucity of ODR violation-detecting tools for MSVC, so I thought I'd write one.
The idea is to do a clean build of your project while logging to a binlog file, which OdrCop2 uses to know what files to parse.
Do the following in order:
1. msbuild YourSolution.slnx /t:YourProject:Rebuild /p:Configuration=Debug /p:Platform=x64 /bl:some.binlog // generates a .binlog file
2. bl2oc.exe <path-to-.binlog> [output-dir] // generates a "compile_commands.json" file
3. OdrCop2 <folder to compile_commands.json> // outputs ODR violations to std out
- enums
- typedefs/aliases
- functions
- UDTs
- unnamed structs/classes/unions/enums
- anonymous namespaces
- hooking up the COFF/.obj file reader (might not need to do this)
- testing, lots of testing