Clang won't warn about dead code.  There may be some linker options to do that (which would catch even more than we catch today).

As far as eliminating dead code, when statically linking, linkers are typically very good about eliminating entire object files that are unused.  I know apple has put some effort into eliminating individual variables / functions in the linker they ship (and in the upcoming llvm-based linker).  I'm not really familiar with what Microsoft's linker will do here.