This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [buildbot] r201508: Build failures after pass C++ conversion
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Richard Henderson <rth at redhat dot com>, Jan-Benedict Glaw <jbglaw at lug-owl dot de>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 Aug 2013 16:35:26 -0400
- Subject: Re: [buildbot] r201508: Build failures after pass C++ conversion
- References: <20130805201605 dot 1748 dot qmail at sourceware dot org> <20130806111256 dot GA16320 at lug-owl dot de> <1375805184 dot 1954 dot 15 dot camel at surprise> <52015DEB dot 4090805 at redhat dot com> <1375824206 dot 5818 dot 24 dot camel at surprise> <mvmvc3idlw8 dot fsf at hawking dot suse dot de>
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)
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