Getting fatal error: 'type_traits' file not found #include <type_traits>, while building clang example
<p>I am trying to build the <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?view=markup" rel="nofollow">PrintFunctionNames</a> example from clang. 
However I get the following error:</p>

<pre><code>[mac-osx:clang/examples/PrintFunctionNames] osx% clang++ -std=c++0x PrintFunctionNames.cpp
In file included from PrintFunctionNames.cpp:15:
In file included from /usr/local/include/clang/Frontend/FrontendPluginRegistry.h:13:
In file included from /usr/local/include/clang/Frontend/FrontendAction.h:22:
In file included from /usr/local/include/clang/Basic/LLVM.h:22:
In file included from /usr/local/include/llvm/Support/Casting.h:19:
/usr/local/include/llvm/Support/type_traits.h:17:10: fatal error: 'type_traits' file not found
#include &lt;type_traits&gt;
</code></pre>

<p>System Info: </p>

<p>clang version 4.0.0 (<a href="http://llvm.org/git/clang.git" rel="nofollow">http://llvm.org/git/clang.git</a> 6197d01def79876e2c1670ced871e10b12c36241) (<a href="http://llvm.org/git/llvm.git" rel="nofollow">http://llvm.org/git/llvm.git</a> 24f7cd87f70ddcc91d50f77e405420c0c27853fd)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /usr/local/bin</p>

<p>OSX 10.11.6</p>

<p>Edit 1:</p>

<p>on making the changes suggested by Alex, I start getting header issues. On fixing it via includes, same error is thrown again</p>

<pre><code>% clang++ -std=c++0x PrintFunctionNames.cpp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I../../../clang/include -I../../../../include -I../../../../../build/include
In file included from PrintFunctionNames.cpp:15:
In file included from ../../../clang/include/clang/Frontend/FrontendPluginRegistry.h:13:
In file included from ../../../clang/include/clang/Frontend/FrontendAction.h:22:
In file included from ../../../clang/include/clang/Basic/LLVM.h:22:
In file included from ../../../../include/llvm/Support/Casting.h:19:
../../../../include/llvm/Support/type_traits.h:17:10: fatal error: 'type_traits' file not found
#include &lt;type_traits&gt;
         ^
1 error generated.
</code></pre>