Opened 12 years ago

Last modified 10 years ago

#4464 new Bugs

gccxml error with msvc 9 and boost

Reported by: Christopher Bruns <cmbruns@…> Owned by: Peder Holt
Milestone: Boost 1.44.0 Component: typeof
Version: Boost 1.43.0 Severity: Problem
Keywords: Cc: cmbruns@…

Description

I am using gccxml, built from current cvs at

www.gccxml.org:/cvsroot/GCC_XML

On Windows XP SP3, with Visual Studio version 9.0.30729.1 SP (SP1)

file test.hpp:

#include <boost/typeof/typeof.hpp>

typing this command:

   gccxml -I"C:/Program Files/boost/boost_1_43_0" test.hpp

yields the following error message:

##################

In file included from C:/Program Files/boost/boost_1_43_0/boost/typeof/typeof.hpp:103,
                 from test3.hpp:1:
C:/Program Files/boost/boost_1_43_0/boost/typeof/msvc/typeof_impl.hpp:151: error: qualified name does not name a class before '{' token

##################

The code in question appears on a block of the form

#if BOOST_WORKAROUND(BOOST_MSVC,==1300)
// Code specific to VC 7.0.
#elif BOOST_WORKAROUND(BOOST_MSVC,>=1400)
// Code for VC 8.0 and above.
#else
// Code commented with "This uses nice VC6.5 and VC7.1 bugfeature"
// that does not work with gccxml.  Error is reported here.
#endif

I'd guess it should be choosing the middle block here. My fumbling attempts at preprocessor debugging suggest that the "BOOST_MSVC" macro is undefined when gccxml is emulating msvc here.

The gccxml preprocessor simulates the definitions of the target compiler, but adds GCCXML to distinguish itself.

Sorry I don't have a patch to submit. I'm unsure what the right way to handle this is.

Change History (2)

comment:1 by Steven Watanabe, 12 years ago

It looks like Boost.Typeof is inconsistent about using BOOST_MSVC vs. _MSC_VER. Does it work if you check _MSC_VER? Alternately, does it work if you change boost/typeof/typeof.hpp to use BOOST_MSVC?

comment:2 by anonymous, 10 years ago

ran into this yesterday, as of now gccxml still doesnt like any of the msvc specific hacks.

however, i dont think we need them here anyway, so this can be avoided by addding && !defined(GCCXML) after #elif defined(_MSC_VER) in boost/typeof/typeof.hpp

Note: See TracTickets for help on using tickets.