Re: [Boost-bugs] [Boost C++ Libraries] #11897: Compile failure in type_traits_detail::mp_valid_impl with CUDA 7.0

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11897: Compile failure in type_traits_detail::mp_valid_impl with CUDA 7.0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-01 09:11:59


#11897: Compile failure in type_traits_detail::mp_valid_impl with CUDA 7.0
-------------------------------+-------------------------
  Reporter: a.grund@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: type_traits
   Version: Boost 1.60.0 | Severity: Showstopper
Resolution: fixed | Keywords:
-------------------------------+-------------------------

Comment (by antar1nd):

 On OSX, it can be reproduced if you compile it for objective-c++ .


 {{{
 #import <Foundation/Foundation.h>
 #include <boost/type_traits/common_type.hpp>

 int main(int argc, const char * argv[]) {
     boost::common_type<int_least64_t, int_least64_t, intmax_t>::type i;
     return 0;
 }
 }}}

 Compiling the above results in :
 {{{
 $ clang++ -std=c++11 -I boost_1_60_0/ -ObjC++ test.mm
 In file included from test.mm:2:
 In file included from boost_1_60_0/boost/type_traits/common_type.hpp:21:
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:28:5: warning:
 declaration does not declare anything [-Wmissing-declarations]
     static boost::true_type check(int);
     ^~~~~~~~~~~~~~~~~~~~~~~
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:31:5: warning:
 declaration does not declare anything [-Wmissing-declarations]
     static boost::false_type check(...);
     ^~~~~~~~~~~~~~~~~~~~~~~~
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:33:27: error: use of
 undeclared identifier 'check'
     using type = decltype(check<F>(0));
                           ^
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:33:33: error: cannot
 refer to class template 'F' without a template argument list
     using type = decltype(check<F>(0));
                                 ^
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:24:35: note: template
 is declared here
 template<template<class...> class F, class... T>
                                   ^
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:37:1: error: no type
 named 'type' in
 'boost::type_traits_detail::mp_valid_impl<common_type_fold, long long,
 long long, long>'
 using mp_valid = typename mp_valid_impl<F, T...>::type;
 ^~~~~
 boost_1_60_0/boost/type_traits/detail/mp_defer.hpp:50:95: note: in
 instantiation of template type alias 'mp_valid' requested here
 template<template<class...> class F, class... T> using mp_defer = typename
 boost::conditional<mp_valid<F, T...>::value, mp_defer_impl<F, T...>,
 mp_empty>::type;
 ^
 boost_1_60_0/boost/type_traits/common_type.hpp:47:55: note: in
 instantiation of template type alias 'mp_defer' requested here
 struct common_type<T1, T2, T...>:
 type_traits_detail::mp_defer<type_traits_detail::common_type_fold, T1, T2,
 T...>
                                                       ^
 test.mm:5:9: note: in instantiation of template class
 'boost::common_type<long long, long long, long>' requested here
         boost::common_type<int_least64_t, int_least64_t, intmax_t>::type
 i;
                ^
 2 warnings and 3 errors generated.
 }}}

 The root cause is the expansion of a macro "'''check'''" defined in the
 OSX_SDK_10.11's AssertMacros.h . Defining either
 BOOST_NO_CXX11_TEMPLATE_ALIASES or BOOST_NO_CXX11_VARIADIC_TEMPLATES
 excludes mp_defer.hpp therefore that works as a workaround. What also
 works is #undef check before this inclusion.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11897#comment:17>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC