[Config] Failure with Clang-3.4 in C++14 mode
"clang++-3.4" -c -x c++ -std=c++1y -stdlib=libc++ -O0 -g -fno-inline -Wall -g -fPIC -DBOOST_ALL_NO_LIB=1 -I".." -o "/home/ben/development/boost/test/build/results/boost/bin.v2/libs/config/test/config_test.test/clang-linux-3.4~c14_libc++/debug/config_test.o" "../libs/config/test/config_test.cpp" In file included from ../libs/config/test/config_test.cpp:76: ../libs/config/test/boost_no_constexpr.ipp:37:3: error: no viable conversion from 'const boost_no_cxx11_constexpr::A' to 'int' X<a> xx; // OK: unique conversion to int ^ ../libs/config/test/boost_no_constexpr.ipp:27:14: note: candidate function not viable: 'this' argument has type 'const boost_no_cxx11_constexpr::A', but method is not marked const constexpr operator int() { return val; } ^ ../libs/config/test/boost_no_constexpr.ipp:28:14: note: candidate function not viable: 'this' argument has type 'const boost_no_cxx11_constexpr::A', but method is not marked const constexpr operator long() { return 43; } ^ In file included from ../libs/config/test/config_test.cpp:231: ../libs/config/test/boost_no_cxx11_user_lit.ipp:64:15: error: invalid operands to binary expression ('const boost_no_cxx11_user_defined_literals::my_literal' and 'boost_no_cxx11_user_defined_literals::my_literal') return ((a == my_literal(0x23)) && (b == my_literal(9))) ? 0 : 1; ~ ^ ~~~~~~~~~~~~~~~~ ../libs/config/test/boost_no_cxx11_user_lit.ipp:22:19: note: candidate function not viable: 'this' argument has type 'const boost_no_cxx11_user_defined_literals::my_literal', but method is not marked const constexpr bool operator==(const my_literal& a) { return val == a.val; } ^ ../libs/config/test/boost_no_cxx11_user_lit.ipp:64:42: error: invalid operands to binary expression ('const boost_no_cxx11_user_defined_literals::my_literal' and 'boost_no_cxx11_user_defined_literals::my_literal') return ((a == my_literal(0x23)) && (b == my_literal(9))) ? 0 : 1; ~ ^ ~~~~~~~~~~~~~ ../libs/config/test/boost_no_cxx11_user_lit.ipp:22:19: note: candidate function not viable: 'this' argument has type 'const boost_no_cxx11_user_defined_literals::my_literal', but method is not marked const constexpr bool operator==(const my_literal& a) { return val == a.val; } ^ ^ 6 warnings and 3 errors generated. Looks like a simple fix of marking the members const. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html http://www.boost.org/development/tests/trunk/developer/output/BP%20x86_64%20C++11-boost-bin-v2-libs-config-test-config_test-test-clang-linux-3-4~c14_libc++-debug.html Ben
Looks like a simple fix of marking the members const. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html
Hopefully https://github.com/boostorg/config/commit/958c9f8a5154f7236f5d1549ab9326cb6a... will fix this. John.
On 14/12/13 03:15, John Maddock wrote:
Looks like a simple fix of marking the members const. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html
Hopefully https://github.com/boostorg/config/commit/958c9f8a5154f7236f5d1549ab9326cb6a... will fix this.
I commented on the commit message, but I don't know if you saw it. ../libs/config/test/boost_no_cxx11_user_lit.ipp:22:19: my_literal::operator== needs a const, too. Then all tests in config should pass. Cheers, Ben
participants (2)
-
Ben Pope
-
John Maddock