Clang Cheatsheet#
Misc Gotchas#
- Compile c file as C++:
clang -xc++ "filename" -std=c++14
- note
-xc++
must come before file list clang
driver won't automatically link C++stdlib
; must pass-stdlib=libc++
- Treating
.h
files as C++ headers (to get around#pragma once
warning) - 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.json
so be sure to use -- - Additional info