Opened 12 years ago

Closed 12 years ago

#4968 closed Bugs (fixed)

Syntax error in boost::exception_detail::diagnostic_information_impl

Reported by: simon.giesecke@… Owned by: Emil Dotchevski
Milestone: To Be Determined Component: exception
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

The following lines (line 139/140) in boost/exception/diagnostic_information.hpp gives a syntax error when trying to instrument code that includes the file using TestCocoon 1.4.0 with Visual C++ 9.0:

tmp << std::string("Dynamic exception type: ") <<    
units::detail::demangle((be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name()) << '\n';

Since BOOST_EXCEPTION_DYNAMIC_TYPEID is a macro that evaluates to ::..., the resulting ::: causes a syntax error (it appears to be fine when using plain Visual C++ 9.0). In any case, it would be safer to either change the macro or this use of it to by adding parentheses:

tmp << std::string("Dynamic exception type: ") <<
units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_.name()) << '\n';

Change History (1)

comment:1 by Emil Dotchevski, 12 years ago

Resolution: fixed
Status: newclosed

Fixed, see release branch revision number 67127.

Note: See TracTickets for help on using tickets.