------- Comment #27 from davek at gcc dot gnu dot org  2010-01-27 15:17 -------
(In reply to comment #26)
> > Apart from include file paths in # lines, the two files are identical.
> 
> I double-checked the compilers used to generate
> them -- the attachments are correct. So the issue
> must be inside the compiler itself, not in its
> stdc++ includes.

Indeed, and that matches what Paolo said in comment 13.  I've now built
r.156253 and here is the output from compiling your testcase; it still shows no
sign of the charXX_t problem:

$ /gnu/gcc/install-obj3/opt/gcc-tools/bin/g++-4  -std=c++0x  o.cpp
In file included from
/usr/include/boost_1_39_0/boost/mpl/aux_/include_preproces
sed.hpp:37:0,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/full_lambda.hpp:4
4,
                 from /usr/include/boost_1_39_0/boost/mpl/lambda.hpp:22,
                 from /usr/include/boost_1_39_0/boost/mpl/iter_fold.hpp:20,
                 from /usr/include/boost_1_39_0/boost/mpl/distance.hpp:18,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/size_impl.hpp:19,

                 from /usr/include/boost_1_39_0/boost/mpl/size.hpp:19,
                 from br.cpp:2:
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:49
2: error: specialization of
'boost::mpl::aux::template_arity<boost::mpl::lambda<
mpl_::na, mpl_::na> >' after instantiation
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:49
2: error: redefinition of 'struct
boost::mpl::aux::template_arity<boost::mpl::la
mbda<mpl_::na, mpl_::na> >'
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:92:
1: error: previous definition of 'struct
boost::mpl::aux::template_arity<boost::
mpl::lambda<mpl_::na, mpl_::na> >'
In file included from /usr/include/boost_1_39_0/boost/mpl/distance.hpp:18:0,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/size_impl.hpp:19,

                 from /usr/include/boost_1_39_0/boost/mpl/size.hpp:19,
                 from br.cpp:2:
/usr/include/boost_1_39_0/boost/mpl/iter_fold.hpp:45:531: error: specialization
of 'boost::mpl::aux::template_arity<boost::mpl::iter_fold<> >' after
instantiati
on
/usr/include/boost_1_39_0/boost/mpl/iter_fold.hpp:45:531: error: redefinition
of
 'struct boost::mpl::aux::template_arity<boost::mpl::iter_fold<> >'
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:92:
1: error: previous definition of 'struct
boost::mpl::aux::template_arity<boost::
mpl::iter_fold<> >'
In file included from /usr/include/boost_1_39_0/boost/mpl/distance.hpp:19:0,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/size_impl.hpp:19,

                 from /usr/include/boost_1_39_0/boost/mpl/size.hpp:19,
                 from br.cpp:2:
/usr/include/boost_1_39_0/boost/mpl/iterator_range.hpp:38:521: error:
specializa
tion of 'boost::mpl::aux::template_arity<boost::mpl::iterator_range<> >' after
i
nstantiation
/usr/include/boost_1_39_0/boost/mpl/iterator_range.hpp:38:521: error:
redefiniti
on of 'struct boost::mpl::aux::template_arity<boost::mpl::iterator_range<> >'
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:92:
1: error: previous definition of 'struct
boost::mpl::aux::template_arity<boost::
mpl::iterator_range<> >'
In file included from
/usr/include/boost_1_39_0/boost/mpl/aux_/size_impl.hpp:19:
0,
                 from /usr/include/boost_1_39_0/boost/mpl/size.hpp:19,
                 from br.cpp:2:
/usr/include/boost_1_39_0/boost/mpl/distance.hpp:74:485: error: specialization
o
f 'boost::mpl::aux::template_arity<boost::mpl::distance<> >' after
instantiation

/usr/include/boost_1_39_0/boost/mpl/distance.hpp:74:485: error: redefinition of
'struct boost::mpl::aux::template_arity<boost::mpl::distance<> >'
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:92:
1: error: previous definition of 'struct
boost::mpl::aux::template_arity<boost::
mpl::distance<> >'
In file included from br.cpp:2:0:
/usr/include/boost_1_39_0/boost/mpl/size.hpp:38:421: error: specialization of
'b
oost::mpl::aux::template_arity<boost::mpl::size<> >' after instantiation
/usr/include/boost_1_39_0/boost/mpl/size.hpp:38:421: error: redefinition of
'str
uct boost::mpl::aux::template_arity<boost::mpl::size<> >'
/usr/include/boost_1_39_0/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:92:
1: error: previous definition of 'struct
boost::mpl::aux::template_arity<boost::
mpl::size<> >'

dkad...@ubik /tmp/boost
$


.... except, of course, if I omit -std=c++0x:


$ /gnu/gcc/install-obj3/opt/gcc-tools/bin/g++-4   o.cpp
In file included from
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/ty
pe_traits:51:0,
                 from
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bi
ts/move.h:38,
                 from
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bi
ts/stl_pair.h:60,
                 from
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/ut
ility:71,
                 from
/usr/include/boost_1_39_0/boost/config/no_tr1/utility.hpp:
21,
                 from
/usr/include/boost_1_39_0/boost/config/select_stdlib_confi
g.hpp:20,
                 from /usr/include/boost_1_39_0/boost/config.hpp:40,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/config/msvc.hpp:1
9,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/config/adl.hpp:17
,
                 from
/usr/include/boost_1_39_0/boost/mpl/aux_/adl_barrier.hpp:1
7,
                 from /usr/include/boost_1_39_0/boost/mpl/bool_fwd.hpp:17,
                 from /usr/include/boost_1_39_0/boost/mpl/bool.hpp:17,
                 from /usr/include/boost_1_39_0/boost/mpl/has_xxx.hpp:18,
                 from /usr/include/boost_1_39_0/boost/mpl/aux_/has_tag.hpp:17,
                 from /usr/include/boost_1_39_0/boost/mpl/sequence_tag.hpp:18,
                 from /usr/include/boost_1_39_0/boost/mpl/size.hpp:18,
                 from br.cpp:2:
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits:112
:42: error: 'char16_t' was not declared in this scope
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits:112
:50: error: template argument 1 is invalid
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits:113
:42: error: 'char32_t' was not declared in this scope
/opt/gcc-trunk/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits:113
:50: error: template argument 1 is invalid


So, the bug is that it #includes tr1_impl even if the compiler is not in c++0x
mode perhaps?  It appears to be coming from the regular type_traits header:

# 1 "/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/stddef.h" 1 3 4
# 45 "/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/cstddef" 2 3
# 43 "/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/type_traits" 2 3
# 51 "/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/type_traits" 3
# 1 "/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits"
1 3
# 30
"/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits"   3
namespace std
{

# 43
"/opt/PREFIX/LIB/gcc/i686-pc-cygwin/4.5.0/include/c++/tr1_impl/type_traits"


Hmmm.  That comes from here:

    44  #if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
    45  #  include <tr1_impl/type_traits>
    46  #else
    47  #  define _GLIBCXX_INCLUDE_AS_CXX0X
    48  #  define _GLIBCXX_BEGIN_NAMESPACE_TR1
    49  #  define _GLIBCXX_END_NAMESPACE_TR1
    50  #  define _GLIBCXX_TR1
    51  #  include <tr1_impl/type_traits>
    52  #  undef _GLIBCXX_TR1
    53  #  undef _GLIBCXX_END_NAMESPACE_TR1
    54  #  undef _GLIBCXX_BEGIN_NAMESPACE_TR1
    55  #  undef _GLIBCXX_INCLUDE_AS_CXX0X
    56  #endif

and then tr1_impl/type_traits has:

   111  #ifdef _GLIBCXX_INCLUDE_AS_CXX0X
   112    _DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
   113    _DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
   114  #endif

That kind of looks peculiar to me, but I don't know how the libstdc headers are
put together.  But why would we #define _GLIBCXX_INCLUDE_AS_CXX0X when we're
not in C++0x mode?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42880

Reply via email to