On Wed, 2013-08-07 at 09:01 +0200, Andreas Schwab wrote: > David Malcolm <dmalc...@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)
commit 7af885276832d17e56cbb8e09787b2d4d95dc5ea Author: David Malcolm <dmalc...@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