Patchwork [buildbot] r201508: Build failures after pass C++ conversion

login
register
mail settings
Submitter David Malcolm
Date Aug. 7, 2013, 8:35 p.m.
Message ID <1375907726.3666.32.camel@surprise>
Download mbox | patch
Permalink /patch/265608/
State New
Headers show

Comments

David Malcolm - Aug. 7, 2013, 8:35 p.m.
On Wed, 2013-08-07 at 09:01 +0200, Andreas Schwab wrote:
> David Malcolm <dmalcolm@redhat.com> writes:
> 
> > diff --git a/gcc/coretypes.h b/gcc/coretypes.h
> > index edb9c8c..54bfe7f 100644
> > --- a/gcc/coretypes.h
> > +++ b/gcc/coretypes.h
> > @@ -169,6 +169,12 @@ typedef const struct basic_block_def *const_basic_block;
> >     in target.h.  */
> >  typedef int reg_class_t;
> >  
> > +class rtl_opt_pass;
> > +
> > +namespace gcc {
> > +  class context;
> > +}
> > +
> 
> This break Ada.
> 
> ../../xgcc -B../../ -c -DIN_GCC  -DUSE_LIBUNWIND_EXCEPTIONS -O2 -g -W -Wall  \
> 		-iquote /usr/local/gcc/gcc-20130807/gcc \
> 		 -iquote . -iquote .. -iquote ../.. -iquote /usr/local/gcc/gcc-20130807/gcc/ada -iquote /usr/local/gcc/gcc-20130807/gcc -I/usr/local/gcc/gcc-20130807/gcc/../include -I/usr/local/gcc/gcc-20130807/Build/./gmp -I/usr/local/gcc/gcc-20130807/gmp -I/usr/local/gcc/gcc-20130807/Build/./mpfr -I/usr/local/gcc/gcc-20130807/mpfr -I/usr/local/gcc/gcc-20130807/mpc/src  \
> 		../rts/targext.c -o targext.o
> In file included from ../rts/targext.c:45:0:
> /usr/local/gcc/gcc-20130807/gcc/coretypes.h:172:1: error: unknown type name 'class'
>  class rtl_opt_pass;
>  ^
> /usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:1: error: unknown type name 'namespace'
>  namespace gcc {
>  ^
> /usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
>  namespace gcc {
>                ^
> make[3]: *** [targext.o] Error 1

Sorry.  How does the attached look?  (am bootstrapping now)
Eric Botcazou - Aug. 8, 2013, 9:24 a.m.
> Sorry.  How does the attached look?  (am bootstrapping now)

Thanks for devising the patch.  However, we are in the process of fixing the 
issue on the Ada side so please do not apply it for now.

Patch

commit 7af885276832d17e56cbb8e09787b2d4d95dc5ea
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Aug 7 15:54:26 2013 -0400

    Fix C++ usage in coretypes.h
    
    gcc/
    	* coretypes.h: Wrap decls using C++ syntax in a #ifdef __cplusplus
    	for the sake of source files still built as pure C.

diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 54bfe7f..b28040a 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -169,11 +169,13 @@  typedef const struct basic_block_def *const_basic_block;
    in target.h.  */
 typedef int reg_class_t;
 
+#ifdef __cplusplus
 class rtl_opt_pass;
 
 namespace gcc {
   class context;
 }
+#endif /* __cplusplus */
 
 #else