Subject: [Boost-bugs] [Boost C++ Libraries] #9100: has_*_operator.hpp generates C6334 using VC++
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-11 05:50:58
#9100: has_*_operator.hpp generates C6334 using VC++
------------------------------+-------------------------
Reporter: ianjirka@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
Version: Boost 1.54.0 | Severity: Problem
Keywords: |
------------------------------+-------------------------
Warning 2 warning C6334: sizeof operator applied to an expression
with an operator might yield unexpected results: Parentheses can be used
to disambiguate certain usages.
c:\users\ian\dev\tensor\main\code\external\boost\latest\boost\type_traits\detail\has_binary_operator.hpp
This can be fixed by adding an extra set of parentheses around
returns_void( ... ). For example:
sizeof((returns_void(...))
For example: has_binary_operator.hpp:95
Was:
BOOST_STATIC_CONSTANT( bool, value =
(sizeof(::boost::type_traits::yes_type) == sizeof( returns_void(
(make<Lhs>() BOOST_TT_TRAIT_OP make<Rhs>(), returns_void_t()) ))) );
With fix:
BOOST_STATIC_CONSTANT( bool, value =
(sizeof(::boost::type_traits::yes_type) == sizeof((returns_void(
(make<Lhs>() BOOST_TT_TRAIT_OP make<Rhs>(), returns_void_t()) )))) );
I was able to fix has_binary_operator.hpp and has_prefix_operator.hpp this
way. I'm sure other metafunctions are affected as well.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9100> 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:14 UTC