Opened 6 years ago

Closed 6 years ago

#12378 closed Bugs (fixed)

Compilation errors with clang 3.8

Reported by: Daniel Laügt <daniel.laugt@…> Owned by: Raffi Enficiaud
Milestone: Boost 1.62.0 Component: test
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Clang 3.8 without c++11 option gives compilation errors. For this clang configuration, BOOST_NO_CXX11_HDR_INITIALIZER_LIST is defined. This should be checked for using the new test api as it uses std::initialize_list.

I've attached a proposal patch fixing the issue.

make[1]: Entering directory `/work/home/phoenix/jenkins/workspace/7.4-code-analysis-clang/tools/boost/libs/test/build' Compiling unit_test_parameters.o... In file included from ../src/unit_test_parameters.cpp:16: In file included from ../../../../../tools/boost/boost/test/impl/unit_test_parameters.ipp:35: In file included from ../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:20: ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:40:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& description = unit_test::static_constant<nfp::typed_keyword<cstring,struct description_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:40:105: error: a space is required between consecutive right angle brackets (use '> >') auto const& description = unit_test::static_constant<nfp::typed_keyword<cstring,struct description_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:41:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& help = unit_test::static_constant<nfp::typed_keyword<cstring,struct help_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:41:98: error: a space is required between consecutive right angle brackets (use '> >') auto const& help = unit_test::static_constant<nfp::typed_keyword<cstring,struct help_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:42:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& env_var = unit_test::static_constant<nfp::typed_keyword<cstring,struct env_var_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:42:101: error: a space is required between consecutive right angle brackets (use '> >') auto const& env_var = unit_test::static_constant<nfp::typed_keyword<cstring,struct env_var_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:43:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& end_of_params = unit_test::static_constant<nfp::typed_keyword<cstring,struct end_of_params_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:43:107: error: a space is required between consecutive right angle brackets (use '> >') auto const& end_of_params = unit_test::static_constant<nfp::typed_keyword<cstring,struct end_of_params_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:44:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& negation_prefix = unit_test::static_constant<nfp::typed_keyword<cstring,struct neg_prefix_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:44:104: error: a space is required between consecutive right angle brackets (use '> >') auto const& negation_prefix = unit_test::static_constant<nfp::typed_keyword<cstring,struct neg_prefix_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:45:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& value_hint = unit_test::static_constant<nfp::typed_keyword<cstring,struct value_hint_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:45:104: error: a space is required between consecutive right angle brackets (use '> >') auto const& value_hint = unit_test::static_constant<nfp::typed_keyword<cstring,struct value_hint_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:46:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& optional_value = unit_test::static_constant<nfp::keyword<struct optional_value_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:46:94: error: a space is required between consecutive right angle brackets (use '> >') auto const& optional_value = unit_test::static_constant<nfp::keyword<struct optional_value_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:47:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& default_value = unit_test::static_constant<nfp::keyword<struct default_value_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:47:93: error: a space is required between consecutive right angle brackets (use '> >') auto const& default_value = unit_test::static_constant<nfp::keyword<struct default_value_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:48:1: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions] auto const& callback = unit_test::static_constant<nfp::keyword<struct callback_t>>::value; ../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:48:88: error: a space is required between consecutive right angle brackets (use '> >') auto const& callback = unit_test::static_constant<nfp::keyword<struct callback_t>>::value;

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:51:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using enum_values = unit_test::static_constant<

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:52:27: error: no member named 'initializer_list' in namespace 'std'

nfp::typed_keyword<std::initializer_list<std::pair<const cstring,EnumType>>, struct enum_values_t>

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:52:76: error: a space is required between consecutive right angle brackets (use '> >')

nfp::typed_keyword<std::initializer_list<std::pair<const cstring,EnumType>>, struct enum_values_t>

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:52:77: error: expected '(' for function-style cast or type construction

nfp::typed_keyword<std::initializer_list<std::pair<const cstring,EnumType>>, struct enum_values_t>

~

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:52:78: error: expected a type

nfp::typed_keyword<std::initializer_list<std::pair<const cstring,EnumType>>, struct enum_values_t>

../../../../../tools/boost/boost/test/utils/runtime/modifier.hpp:52:101: error: expected ';' after alias declaration

nfp::typed_keyword<std::initializer_list<std::pair<const cstring,EnumType>>, struct enum_values_t>

;

In file included from ../src/unit_test_parameters.cpp:16: In file included from ../../../../../tools/boost/boost/test/impl/unit_test_parameters.ipp:35: In file included from ../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:22: ../../../../../tools/boost/boost/test/utils/runtime/argument_factory.hpp:137:69: error: use of undeclared identifier 'enum_values'

std::vector<std::pair<cstring,EnumType> > const& values = m[enum_values<EnumType>::value];

../../../../../tools/boost/boost/test/utils/runtime/argument_factory.hpp:137:81: error: 'EnumType' does not refer to a value

std::vector<std::pair<cstring,EnumType> > const& values = m[enum_values<EnumType>::value];

../../../../../tools/boost/boost/test/utils/runtime/argument_factory.hpp:127:19: note: declared here template<typename EnumType>

../../../../../tools/boost/boost/test/utils/runtime/argument_factory.hpp:137:90: error: no member named 'value' in the global namespace; did you mean 'values'?

std::vector<std::pair<cstring,EnumType> > const& values = m[enum_values<EnumType>::value];

values

../../../../../tools/boost/boost/test/utils/runtime/argument_factory.hpp:137:58: note: 'values' declared here

std::vector<std::pair<cstring,EnumType> > const& values = m[enum_values<EnumType>::value];

In file included from ../src/unit_test_parameters.cpp:16: In file included from ../../../../../tools/boost/boost/test/impl/unit_test_parameters.ipp:35: ../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:256:23: warning: default template arguments for a function template are a C++11 extension [-Wc++11-extensions]

template<typename Modifiers=nfp::no_params_type>

~

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:302:23: warning: default template arguments for a function template are a C++11 extension [-Wc++11-extensions]

template<typename Modifiers=nfp::no_params_type>

~

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:368:23: warning: default template arguments for a function template are a C++11 extension [-Wc++11-extensions]

template<typename Modifiers=nfp::no_params_type>

~

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:377:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]

auto const& values = m[enum_values<EnumType>::value];

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:377:32: error: use of undeclared identifier 'enum_values'

auto const& values = m[enum_values<EnumType>::value];

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:377:44: error: 'EnumType' does not refer to a value

auto const& values = m[enum_values<EnumType>::value];

../../../../../tools/boost/boost/test/utils/runtime/parameter.hpp:362:19: note: declared here template<typename EnumType, args_amount a = runtime::OPTIONAL_PARAM>

Attachments (1)

modifier.hpp.patch (547 bytes ) - added by Daniel Laügt <daniel.laugt@…> 6 years ago.

Download all attachments as: .zip

Change History (4)

by Daniel Laügt <daniel.laugt@…>, 6 years ago

Attachment: modifier.hpp.patch added

comment:1 by Daniel Laügt <daniel.laugt@…>, 6 years ago

comment:2 by Raffi Enficiaud, 6 years ago

Milestone: To Be DeterminedBoost 1.62.0
Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

comment:3 by Raffi Enficiaud, 6 years ago

Resolution: fixed
Status: assignedclosed

Released in 1.62

Note: See TracTickets for help on using tickets.