[GCC-XML] GCCXML chokes on <complex>

Brad King brad.king at kitware.com
Thu Jun 3 09:02:04 EDT 2010


Steve M. Robbins wrote:
> Hi Brad,
> 
> Thanks for the hint.
> 
> On Mon, May 17, 2010 at 01:07:41PM -0400, Brad King wrote:
> 
>> I think the answer is to tweak the header to turn
>>
>>   inline namespace __gnu_cxx_ldbl128 { ... }
>>
>> into just the inside part:
>>
>>   ...
>>
>> It may have to be done everywhere that namespace declaration
>> appears.
> 
> Hmm.  So the "inline namespaces" all appear to happen in c++config.h,
> which I found on the alpha in
> 
>   /usr/include/c++/4.4/alpha-linux-gnu/bits/c++config.h
> 
> Given the pathname, I assume there are arch-specific bits in there.
> Indeed, the file differs between alpha and x86_64.  However, I found
> that I had to put it into GCC/4.4/bits/c++config.h -- and NOT
> GCC/4.4/alpha-linux-gnu/bits/c++config.h to get gccxml to find it.
> It's not clear to me how to do this tweaking in an architecture-specific
> manner.
> 
> Anway, I did it by hand on alpha and the compile now fails elsewhere:
> 
> In file included from /usr/include/c++/4.4/bits/locale_facets.h:2599,
>                  from /usr/include/c++/4.4/bits/basic_ios.h:39,
>                  from /usr/include/c++/4.4/ios:45,
>                  from /usr/include/c++/4.4/istream:40,
>                  from /usr/include/c++/4.4/sstream:39,
>                  from /usr/include/c++/4.4/complex:47,
>                  from complex.cc:1:
> /usr/include/c++/4.4/bits/locale_facets.tcc:1279: error: explicit instantiation of non-template 'const int std::num_put'
> /usr/include/c++/4.4/bits/locale_facets.tcc:1279: error: expected `;' before '<' token
> .... plus plenty more similar ...
> 
> The line in question contains this:
> 
>   extern template
>     const num_put<char>&
>     use_facet<num_put<char> >(const locale&);
> 
> I'm stumped again.  The output from gccxml -E complex.cc contains this
> 
> namespace __gnu_cxx_ldbl128 {
>   template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
>     class num_get;
>   template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
>     class num_put;
> }
> 
> I'm not sure why locale_facets is looking for std::num_put but
> it is really in namespace __gnu_cxx_ldbl128.  Any ideas?

I think that's because you removed the inline namespace in the
other hack.  The __gnu_cxx_ldbl128 namespace is supposed to be
an "inline" namespace meaning that its members are visible in
the containing namespace.  Now that the inline keyword has been
removed (and isn't supported by gccxml's parser anyway), the
symbols are not visible in std::.  You need to remove all uses
of this namespace, not just the first one.

-Brad



More information about the gccxml mailing list