Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7053 closed Bugs (fixed)

lexical_cast and gtest

Reported by: anonymous Owned by: John Maddock
Milestone: Boost 1.52.0 Component: math
Version: Boost 1.50.0 Severity: Showstopper
Keywords: Cc: antoshkka@…

Description

Hello.

VS 2005 SP1
googletest compiled with 'GTEST_USE_OWN_TR1_TUPLE=0'
I use Boost 1.48 - ok
If i switch to 1.50:

#include "stdafx.h"

#include <gtest/gtest.h>
#include <boost/lexical_cast.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

error C2146: syntax error : missing ';' before identifier 'BOOST_NO_MACRO_EXPAND'
error C2433: 'fpclassify_imp' : 'inline' not permitted on data declarations
error C2065: 'T' : undeclared identifier
error C2146: syntax error : missing ')' before identifier 't'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2059: syntax error : ')'

Attachments (1)

lexical_case_failure.zip (1.5 KB ) - added by anonymous 10 years ago.
simple VS 2005 project exposing same issue without gtest

Download all attachments as: .zip

Change History (4)

by anonymous, 10 years ago

Attachment: lexical_case_failure.zip added

simple VS 2005 project exposing same issue without gtest

comment:1 by Antony Polukhin, 10 years ago

Cc: antoshkka@… added
Component: lexical_castmath
Milestone: To Be DeterminedBoost 1.51.0
Owner: changed from Antony Polukhin to John Maddock
Severity: ProblemShowstopper

Build failure is caused by adding boost/tr1/tr1 to compiler's include search path.
Reproduced it on gcc:

In file included from ../../trunk/boost/math/complex/details.hpp:20:0,
                 from ../../trunk/boost/math/complex/asin.hpp:9,
                 from ../../trunk/boost/math/complex.hpp:10,
                 from ../../trunk/boost/tr1/complex.hpp:13,
                 from ../../trunk/boost/tr1/tr1/complex:28,
                 from ../../trunk/boost/math/special_functions/math_fwd.hpp:31,
                 from ../../trunk/boost/math/special_functions/sign.hpp:17,
                 from ../../trunk/boost/lexical_cast.hpp:153,
                 from ../../trunk/libs/conversion/test/lexical_cast_arrays_test.cpp:11:
../../trunk/boost/math/special_functions/fpclassify.hpp:123:27: error: expected initializer before 'BOOST_NO_MACRO_EXPAND'

Looks more like a boost::math or boost::tr1 library bug

comment:2 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [79420]) Fix double inclusion of <complex> which causes use of Boost.TR1 to fail. Fixes #7053.

comment:3 by John Maddock, 10 years ago

Milestone: Boost 1.51.0Boost 1.52.0
Note: See TracTickets for help on using tickets.