I'm unsure if that's even possible in C++ for a "normal program" instead of requiring a full-fledged compiler and even maybe a linker, as C++ syntax is completely context-dependent. There's no way to tell if i+=b;
increments a value or is actually a dynamic hierarchy cast that prints a message to screen and invokes a vector copy with data downloaded from the internet.
I'd venture there's something in Clang that does this? (clang-tidy, clang-format, who knows), since they implement the syntax tree parser thing.