Opened 8 months ago

Closed 5 months ago

#13525 closed Bugs (fixed)

Boost Test 1.67.0: Compilation error with GCC 4.6.3

Reported by: kratz00@… Owned by: Raffi Enficiaud
Milestone: Boost 1.68.0 Component: test
Version: Boost 1.67.0 Severity: Regression
Keywords: Cc:

Description

I was just testing 1.67.0 and ran into the following issue (1.66.0 works). Used compiler: g++ (Ubuntu/Linaro??? 4.6.3-1ubuntu5) 4.6.3

Boost build commands:

./bootstrap.sh --with-libraries=filesystem,exception,program_options,test,signals --prefix=/usr
./b2 link=shared runtime-link=shared optimization=speed variant=release cxxflags="-std=c++0x" install

The error message:

gcc.compile.c++ bin.v2/libs/test/build/gcc-4.6/release/link-static/threading-multi/test_main.o
In file included from ./boost/test/unit_test_suite.hpp:18:0,
                 from ./boost/test/impl/test_main.ipp:19,
                 from libs/test/src/test_main.cpp:13:
./boost/test/tree/test_case_template.hpp: In constructor ‘boost::unit_test::ut_detail::template_test_case_gen<TestCaseTemplate, std::tuple<_Elements ...> >::template_test_case_gen(boost::unit_test::const_string, boost::unit_test::const_string, std::size_t)’:
./boost/test/tree/test_case_template.hpp:172:15: error: expected nested-name-specifier before ‘tuple_t’
./boost/test/tree/test_case_template.hpp:172:15: error: ‘tuple_t’ has not been declared
./boost/test/tree/test_case_template.hpp:172:23: error: expected ‘;’ before ‘=’ token
./boost/test/tree/test_case_template.hpp:172:23: error: expected primary-expression before ‘=’ token
./boost/test/tree/test_case_template.hpp:172:60: error: expected primary-expression before ‘;’ token
./boost/test/tree/test_case_template.hpp:173:15: error: expected nested-name-specifier before ‘this_type’
./boost/test/tree/test_case_template.hpp:173:15: error: ‘this_type’ has not been declared
./boost/test/tree/test_case_template.hpp:173:25: error: expected ‘;’ before ‘=’ token
./boost/test/tree/test_case_template.hpp:173:25: error: expected primary-expression before ‘=’ token
./boost/test/tree/test_case_template.hpp:173:68: error: ‘tuple_t’ was not declared in this scope
./boost/test/tree/test_case_template.hpp:173:76: error: template argument 2 is invalid
./boost/test/tree/test_case_template.hpp:174:15: error: expected nested-name-specifier before ‘single_test_gen’
./boost/test/tree/test_case_template.hpp:174:15: error: ‘single_test_gen’ has not been declared
./boost/test/tree/test_case_template.hpp:174:31: error: expected ‘;’ before ‘=’ token
./boost/test/tree/test_case_template.hpp:174:31: error: expected primary-expression before ‘=’ token
./boost/test/tree/test_case_template.hpp:174:59: error: ‘this_type’ was not declared in this scope
./boost/test/tree/test_case_template.hpp:174:86: error: template argument 1 is invalid
./boost/test/tree/test_case_template.hpp:176:9: error: ‘single_test_gen’ was not declared in this scope
./boost/test/tree/test_case_template.hpp:176:25: error: expected ‘;’ before ‘op’
./boost/test/tree/test_case_template.hpp:178:24: error: the value of ‘tuple_t’ is not usable in a constant expression
./boost/test/tree/test_case_template.hpp:173:68: note: ‘tuple_t’ was not declared ‘constexpr’
./boost/test/tree/test_case_template.hpp:178:33: error: ‘op’ was not declared in this scope
./boost/test/tree/test_case_template.hpp:178:33: note: suggested alternative:
./boost/test/tools/assertion.hpp:65:14: note:   ‘boost::test_tools::assertion::op’

    "g++"   -m32 -pthread -O3 -finline-functions -Wno-inline -Wall -pedantic -march=i686 -std=c++0x -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_TIMER_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/test/build/gcc-4.6/release/link-static/threading-multi/test_main.o" "libs/test/src/test_main.cpp"

...failed gcc.compile.c++ bin.v2/libs/test/build/gcc-4.6/release/link-static/threading-multi/test_main.o...

Change History (7)

comment:1 Changed 8 months ago by Raffi Enficiaud

Owner: changed from Gennadiy Rozental to Raffi Enficiaud
Status: newassigned

This is apparently a defect in gcc. Does this patch fix the error for you? https://github.com/boostorg/test/pull/140

comment:2 Changed 8 months ago by kratz00@…

Hi Raffi

Thanks for your feedback. Yes, this patch fixes the error for me.

comment:3 Changed 8 months ago by Raffi Enficiaud

I applied a different patch to the branch topic/13525-compilation-error-GCC-4-6-3. Would you have a chance to try this out?

Thanks Raffi

comment:4 Changed 8 months ago by Raffi Enficiaud

Milestone: To Be DeterminedBoost 1.68.0
Severity: ShowstopperRegression

comment:5 Changed 7 months ago by kratz00@…

Hi Raffi

I have tested the branch you mentioned and it fixes the error too.

comment:6 Changed 6 months ago by Raffi Enficiaud

Merged to develop

comment:7 Changed 5 months ago by Raffi Enficiaud

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.