Project

General

Profile

Actions

Bug #4545

closed

Build fails with clang-6.0

Added by Davide Pesavento over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Build
Target version:
Start date:
03/10/2018
Due date:
% Done:

100%

Estimated time:

Description

clang-6.0 started warning about instances of the most vexing parse, e.g.:

[172/367] Compiling tests/unit-tests/key-locator.t.cpp
../tests/unit-tests/key-locator.t.cpp:54:36: error: parentheses were disambiguated as redundant parentheses around declaration of variable named 'wire' [-Werror,-Wvexing-parse]
  BOOST_REQUIRE_NO_THROW(KeyLocator(wire));
                                   ^~~~~~
/usr/include/boost/test/tools/old/interface.hpp:146:72: note: expanded from macro 'BOOST_REQUIRE_NO_THROW'
#define BOOST_REQUIRE_NO_THROW( S )         BOOST_CHECK_NO_THROW_IMPL( S, REQUIRE )
                                                                       ^
/usr/include/boost/test/tools/old/interface.hpp:134:9: note: expanded from macro 'BOOST_CHECK_NO_THROW_IMPL'
        S;                                                                              \
        ^
../tests/unit-tests/key-locator.t.cpp:54:36: note: add a variable name to declare a 'ndn::KeyLocator' initialized with 'wire'
  BOOST_REQUIRE_NO_THROW(KeyLocator(wire));
                                   ^
                                    varname
/usr/include/boost/test/tools/old/interface.hpp:146:72: note: expanded from macro 'BOOST_REQUIRE_NO_THROW'
#define BOOST_REQUIRE_NO_THROW( S )         BOOST_CHECK_NO_THROW_IMPL( S, REQUIRE )
                                                                       ^
/usr/include/boost/test/tools/old/interface.hpp:134:9: note: expanded from macro 'BOOST_CHECK_NO_THROW_IMPL'
        S;                                                                              \
        ^
../tests/unit-tests/key-locator.t.cpp:54:26: note: add enclosing parentheses to perform a function-style cast
  BOOST_REQUIRE_NO_THROW(KeyLocator(wire));
                         ^
                         (
/usr/include/boost/test/tools/old/interface.hpp:146:72: note: expanded from macro 'BOOST_REQUIRE_NO_THROW'
#define BOOST_REQUIRE_NO_THROW( S )         BOOST_CHECK_NO_THROW_IMPL( S, REQUIRE )
                                                                       ^
/usr/include/boost/test/tools/old/interface.hpp:134:9: note: expanded from macro 'BOOST_CHECK_NO_THROW_IMPL'
        S;                                                                              \
        ^
../tests/unit-tests/key-locator.t.cpp:54:36: note: remove parentheses to silence this warning
  BOOST_REQUIRE_NO_THROW(KeyLocator(wire));
                                   ^    ~

/usr/include/boost/test/tools/old/interface.hpp:146:72: note: expanded from macro 'BOOST_REQUIRE_NO_THROW'
#define BOOST_REQUIRE_NO_THROW( S )         BOOST_CHECK_NO_THROW_IMPL( S, REQUIRE )
                                                                       ^
/usr/include/boost/test/tools/old/interface.hpp:134:9: note: expanded from macro 'BOOST_CHECK_NO_THROW_IMPL'
        S;                                                                              \
        ^
Actions

Also available in: Atom PDF