[Bug c++/50096] New: GCC 4.X doesn't compile Clang on Sparc Solaris

2011-08-16 Thread javpicorel at gmail dot com
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
'::bad::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


[Bug c++/50096] GCC 4.X doesn't compile Clang on Sparc Solaris

2011-08-16 Thread javpicorel at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50096

--- Comment #2 from Javier  2011-08-16 09:36:53 
UTC ---
(In reply to comment #1)
> please read the bug reporting instructions and provide the information
> requested:
> http://gcc.gnu.org/bugs/ - specifically provide preprocessed source, not a 
> URL.
>  Ideally reduce the code to the minimum example demonstrating the problem.
> 
> To me the error looks like it would be produced by this incorrect code:
> 
> namespace clang
> {
> 
> struct SourceRange { };
> 
> struct Stmt { };
> 
> struct AsmStmt : Stmt {
>   SourceRange f() const;
> };
> 
> SourceRange (clang::Stmt::*p)() = &AsmStmt::f;
> 
> }

Sorry about that I forgot to read them. 

This code do compile on x86 so this has to be some c++ front-end bug, that is
what clang guys told me.


[Bug c++/50096] GCC 4.X doesn't compile Clang on Sparc Solaris

2011-08-16 Thread javpicorel at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50096

--- Comment #5 from Javier  2011-08-16 21:52:21 
UTC ---
(In reply to comment #4)
> Are you sure you haven't edited Stmt.cpp to remove 'const' from the definition
> of the getSourceRange_t typedef?  That would also explain the error.

ups! I though I didn't touch it but that was the problem!!! Thank you! Sorry
for bother...

just one thing, how did you know it?

Regards