clang++ is awesome, goodbye g++
I finally got around to reading up on the clang compiler and I love it. The error messages are so helpful. Here's a quick example with a syntax error. Lets compile it on the command line.
#include <iostream> int main() { std::cotut << "Hello World"; return 0; }
What happens when I run the code with g++?
paulsolt@~/dev $ g++ test.cpp test.cpp: In function ‘int main()’: test.cpp:3: error: ‘cotut’ is not a member of ‘std’
Here's what happens in clang++, notice how it highlights the position and it's actually more helpful in fixing the error.
paulsolt@~/dev $ clang++ test.cpp test.cpp:4:7: error: no member named 'cotut' in namespace 'std'; did you mean 'cout'? std::cotut << "Hello World"; ~~~~~^~~~~ cout /usr/include/c++/4.2.1/iostream:63:18: note: 'cout' declared here extern ostream cout; ///< Linked to standard output