clang build error, error: ISO C++ forbids compound-literals

I'm building clang 2.7 on my box, it failed as:

llvm[4]: Compiling Lexer.cpp for Release build
In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h:34,
                 from Lexer.cpp:1108:
/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/xmmintrin.h: In
function `float __vector__ _mm_set_ps(float, float, float, float)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/xmmintrin.h:894: error:
ISO C++ forbids compound-literals
In file included from Lexer.cpp:1108:
/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h: In
function `double __vector__ _mm_set_pd(double, double)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/emmintrin.h:118: error:
ISO C++ forbids compound-literals
make[4]: *** [/home/work/lileding/pkgsrc/lang/clang/work/llvm-2.7/tools/clang/lib/Lex/Release/Lexer.o]
Error 1

I've tried both Release and Debug+Assert, all the same.
Anyone can help me?

My box uses RHEL 4.3, gcc 3.4.5.

best wishes
whisper :slight_smile:

Your include paths are problematic. Clang provides its own versions of the SSE headers and should use those, but apparently on your system the GCC ones are preferred.

Sebastian

Thanks for Sebastian's explain.
But how can I specify the include paths for clang, I just do a
./configure; make under llvm directory.

best wishes
whisper :slight_smile: