Why does clang++ compile this:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}
and do not want compile this:
#include <iostream>
int main()
{
std::cout << "FFFF\n";
return 0;
}
???
command line:
clang++ -c hello.cpp -emit-llvm -o hello.bc
too many errors emitted like this:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xrefwrap:222:22:
note:
expanded from macro '_CLASS_RESULT_OF_PMF_OPT_0X'
__thiscall, X2, X3, X4)
Windows 7 64, clang-3.2, llvm-3.2, VS2012
=====UPDATE=====
Command line (with -v):
clang++ -c hello.cpp -emit-llvm -o hello.bc -v
What I get:
clang version 3.2 (tags/RELEASE_32/final)
Target: i686-pc-win32
Thread model: posix
"C:/llvm/clang/build/bin/Debug/clang++.exe" -cc1 -triple i686-pc-win32 -emit-ll
vm-bc -disable-free -main-file-name 321.cpp -mrelocation-model static -mdisable-
fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -m
omit-leaf-frame-pointer -v -coverage-file "C:\llvm\3211.bc" -resource-dir "C:/
llvm/clang/build/bin/Debug\..\lib\clang\3.2" -fmodule-cache-path "C:\Users\
\kpdev\AppData\Local\Temp\clang-module-cache" -internal-isystem C:/llvm/clan
g/build/bin/Debug/../lib/clang/3.2/include -internal-isystem "C:\Program Files
(x86)\Microsoft Visual Studio 11.0\VC\include" -internal-isystem "C:\Program
Files (x86)\Windows Kits\8.0\\include" -std=c++11 -fdeprecated-macro -ferro
r-limit 3 -fmessage-length 80 -mstackrealign -fms-extensions -fms-compatibility
-fmsc-version=1300 -fdelayed-template-parsing -fobjc-runtime=gcc -fobjc-default-
synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -f
color-diagnostics -o "C:\llvm\3211.bc" -x c++ "C:\llvm\321.cpp"
clang -cc1 version 3.2 based upon LLVM 3.2svn default target i686-pc-win32
#include "..." search starts here:
#include <...>search starts here:
C:/llvm/clang/build/bin/Debug/../lib/clang/3.2/include
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
C:\Program Files (x86)\Windows Kits\8.0\include
End of search list.
In file included from C:\llvm\321.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\inc
lude\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\inc
lude\istream:6:
...etc.
and then:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\type_traits:1072:
33: error:
'_Ty' does not refer to a value
_HAS_TRIVIAL_MOVE_CONSTRUCTOR(_Ty)
^
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\type_traits:52:38
: note:
expanded from macro '_HAS_TRIVIAL_MOVE_CONSTRUCTOR'
&& __has_trivial_move_constructor(_Ty)>
^
...etc.
So... -internal-isystem point to wrong path. How to change it ?