http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50096
Bug #: 50096 Summary: GCC 4.X doesn't compile Clang on Sparc Solaris Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: javpico...@gmail.com Machine: SunOS parsapc12 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Blade-1000 GCC: Using built-in specs. Target: sparc-sun-solaris2.10 Configured with: ../configure --with-gnu-as --with-as=/usr/local/bin/as --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --prefix=/export/home/parsa/tools/gcc4.3.3 Thread model: posix gcc version 4.3.3 (GCC) LLVM: trunk Clang: trunk I've tried GCC 4.3.3, GCC 4.5.3 and GCC 4.7.0 and they misscompile this clang library: /export/home/picorel/filesCloud9/llvm-trunk/obj-debug/tools/clang/lib/AST/ Stmt.cpp This type of errors (there are hundreds but refering to different StmtNodes.in line) : In file included from /export/home/picorel/filesCloud9/llvm-trunk/tools/clang/lib/AST/Stmt.cpp:138: /export/home/picorel/filesCloud9/llvm-trunk/obj-debug/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc: In function 'void check_implementations()': /export/home/picorel/filesCloud9/llvm-trunk/obj-debug/tools/clang/lib/AST/../../ include/clang/AST/StmtNodes.inc:15: error: cannot convert 'clang::SourceRange (clang::AsmStmt::*)()const' to 'clang::SourceRange (clang::Stmt::*)()' for argument '1' to '<unnamed>::bad<unnamed>::implements_getSourceRange(clang::SourceRange (clang::Stmt::*) So looking at the code this is what what we have in Stmt.cpp: static inline void check_implementations() { 00134 #define ABSTRACT_STMT(type) 00135 #define STMT(type, base) \ 00136 ASSERT_IMPLEMENTS_children(type); \ 00137 ASSERT_IMPLEMENTS_getSourceRange(type); 00138 #include "clang/AST/StmtNodes.inc" 00139 } and in StmtNodes: 00012 #ifndef ASMSTMT 00013 # define ASMSTMT(Type, Base) STMT(Type, Base) 00014 #endif 00015 ASMSTMT(AsmStmt, Stmt) 00016 #undef ASMSTMT Clang guys told me that the code is correct and it works and that this is a gcc issue. Full Stmt.cpp here: http://clang.llvm.org/doxygen/Stmt_8cpp_source.html Regards