[Boost-bugs] [Boost C++ Libraries] #13037: <boost/variant/polymorphic_get.hpp> is missing include <boost/type_traits/is_const.hpp>

Subject: [Boost-bugs] [Boost C++ Libraries] #13037: <boost/variant/polymorphic_get.hpp> is missing include <boost/type_traits/is_const.hpp>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-19 06:42:06


#13037: <boost/variant/polymorphic_get.hpp> is missing include
<boost/type_traits/is_const.hpp>
-------------------------------------------+---------------------
 Reporter: Adam Badura <adam.f.badura@…> | Owner: ebf
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: variant
  Version: Boost 1.64.0 | Severity: Problem
 Keywords: variant |
-------------------------------------------+---------------------
 Trivial demonstration can be made by preparing a source file containing
 nothing but an inclusion of the `polymorphic_get.hpp`:
 {{{#!c++
 #include <boost/variant/polymorphic_get.hpp>
 }}}
 on GCC 6.3 with options `-Wall -Wextra -std=c++14` compiling such file
 produces errors:
 {{{
 In file included from Test.cpp:1:0:
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp: In
 member function
 â€˜boost::detail::variant::get_polymorphic_visitor<Base>::pointer
 boost::detail::variant::get_polymorphic_visitor<Base>::operator()(U&)
 const’:
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:18:
 error: ‘is_const’ is not a member of ‘boost’
                  (boost::is_const<base_t>::value ||
 !boost::is_const<U>::value)
                   ^~~~~
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:18:
 note: suggested alternative:
 In file included from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/bits/move.h:57:0,
                  from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/bits/nested_exception.h:40,
                  from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/exception:171,
                  from
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:15,
                  from Test.cpp:1:
 /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/type_traits:652:12: note:
 â€˜std::is_const’
      struct is_const
             ^~~~~~~~
 In file included from Test.cpp:1:0:
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:41:
 error: ‘::value’ has not been declared
                  (boost::is_const<base_t>::value ||
 !boost::is_const<U>::value)
                                          ^~
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:53:
 error: ‘is_const’ is not a member of ‘boost’
                  (boost::is_const<base_t>::value ||
 !boost::is_const<U>::value)
                                                      ^~~~~
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:53:
 note: suggested alternative:
 In file included from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/bits/move.h:57:0,
                  from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/bits/nested_exception.h:40,
                  from /usr/lib/gcc/x86_64-pc-
 cygwin/6.3.0/include/c++/exception:171,
                  from
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:15,
                  from Test.cpp:1:
 /usr/lib/gcc/x86_64-pc-cygwin/6.3.0/include/c++/type_traits:652:12: note:
 â€˜std::is_const’
      struct is_const
             ^~~~~~~~
 In file included from Test.cpp:1:0:
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:68:
 warning: logical not is only applied to the left hand side of comparison
 [-Wlogical-not-parentheses]
                  (boost::is_const<base_t>::value ||
 !boost::is_const<U>::value)
                                                                     ^
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:121:71:
 error: ‘::value’ has not been declared
                  (boost::is_const<base_t>::value ||
 !boost::is_const<U>::value)
                                                                        ^~
 /cygdrive/c/Programming/boost_1_64_0/boost/variant/polymorphic_get.hpp:125:9:
 error: template argument 2 is invalid
> tag_t;
          ^

 }}}

 Workaround it trivial - one needs to include `is_const.hpp` before
 including `polymorphic_get.hpp`:
 {{{#!c++
 #include <boost/type_traits/is_const.hpp>
 #include <boost/variant/polymorphic_get.hpp>
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/13037>
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-05-19 06:44:58 UTC