From personal experience, code I wrote that didn't compile with Clang was my own fault. Clang was right not to accept it and GCC was wrong. These are mostly corner cases that are very easy to get wrong when writing code. For example, I didn't know that const objects should not have a compiler-generated default constructor. GCC would generate one just fine. Clang wouldn't because the standard says that user is responsible for providing it. (GCC got fixed now, but only after Clang showed that this was an issue.)
This is why I now mainly use Clang while developing (I run it through GCC and Intel C++ now and then for brevity though.) It helps in producing more correct code by refusing to compile wrong code. The error messages are also much clearer than GCC's, where you already need to know in advance what the error means by having encountered it before.
This is why I now mainly use Clang while developing (I run it through GCC and Intel C++ now and then for brevity though.) It helps in producing more correct code by refusing to compile wrong code. The error messages are also much clearer than GCC's, where you already need to know in advance what the error means by having encountered it before.
Comment