Clang Cheatsheet#
Misc Gotchas#
- Compile c file as C++:
clang -xc++ "filename" -std=c++14 - note
-xc++must come before file list clangdriver won't automatically link C++stdlib; must pass-stdlib=libc++- Treating
.hfiles as C++ headers (to get around#pragma oncewarning) - pass
-xc++-header - for
clang-cl,/clang:-xc++-header - NOTE: don't pass
-xc++and-xc++-header - NOTE: might have ordering issues in
compile_commands.jsonso be sure to use -- - Additional info