Error while compiling clang 2.9 on linux

error is :

llvm-2.9/tools/clang/lib/AST/Expr.cpp:111: note:
clang::SourceLocation <unnamed>::getExprLocImpl(const clang::Expr*,
clang::SourceLocation (clang::Expr::*)() const) [with E =
clang::StringLiteral]
<path to src>/llvm-build/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:551:
error: call of overloaded `getExprLocImpl(const clang::Expr* const,
clang::SourceLocation (clang::Expr::*)() const)' is ambiguous
/< path to src >/llvm-2.9/tools/clang/lib/AST/Expr.cpp:101: note:
candidates are: clang::SourceLocation <unnamed>::getExprLocImpl(const
clang::Expr*, clang::SourceLocation (T::*)() const) [with E =
clang::SubstNonTypeTemplateParmPackExpr, T = clang::Expr]

Anyone know why this happened ?

Thanks

It's probably a bug in the GCC you're using to build Clang. Which GCC version is this?

  - Doug

It's probably a bug in the GCC you're using to build Clang. Which GCC version is this?

Probably 3.x. One cannot compile clang with gcc 3.x. There is a
workaround though.

Whats the workaround ? I cannot get hold of gcc 4.x....

Whats the workaround ? I cannot get hold of gcc 4.x....

http://pastebin.com/k6Zq5kkv

Thanks, that fixed that problem. Now I am getting another error:

In file included from
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/emmintrin.h:34,
                 from <path to src>/tools/clang/lib/Lex/Lexer.cpp:1520:
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/xmmintrin.h: In
function `float __vector__ _mm_set_ps(float, float, float, float)':
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/xmmintrin.h:894: error:
ISO C++ forbids compound-literals

The internet tell that this is due to the wrong SSE library being
used.... how can this be rectified ?