Closed LitMSCTBB closed 2 years ago
We repro the issue. It repros with mingw/gcc but not with msvc/cl.exe. I'm looking into the root cause of the parser error...
This error is a cascading parse failure caused by our lack of support for float128 on Windows: https://github.com/microsoft/vscode-cpptools/issues/9558 . The error doesn't occur if you avoid headers that have a dependency on the float128 type, which may be difficult to do, i.e. if you can somehow force BOOST_MATH_USE_FLOAT128 to always be undefined.
Another potential workaround is to move the headers you need before the headers that have a dependency on the __float128 type, because that missing dependency causes types defined afterwards to fail to compile. That may also be hard to do to the complicated include dependencies of the boost/geometry headers.
Also, the error doesn't repro on Linux, so another potential workaround is to use WSL instead of mingw.
Closing as duplicate.
Environment
includePath
in c_cpp_properties.json is correct and exactly matches the paths used for includes for the cpp compilationBug Summary and Steps to Reproduce
Bug Summary: IntelliSense seems to get very confused on various types in the boost library (specifically boost geometry) and also sometimes reports inaccurate type descriptions when custom structs or other libraries, such as SFML, coexist with boost.
model
is not recognized as a subspace ofboost::geometry
(call itbg
), and this leads tobg::model::point<double, 2, bg::cs::cartesian>
to be considered as an<error-type>
causing any instances ofpoint
to be considered undefined. This further invalidatesbox
in a similar manner.distance
is also not recognized as a function in thebg
namespace.rtree
,quadratic
,intersects
,satisfies
, etc. are not recognized in thebg::index
namespace and thus make my rtree instances undefined.Node
, but IntelliSense thinks that it falls under theboost
namespace i.e. each instance ofNode
is actually an instance ofboost::Node
, which is not a real thingNode
exists (boost::sf
, or sometimes it's evenstd::sf
???) Also some errors necessarily related toboost
but are still bugs nonetheless:using NodeRef = std::reference_wrapper<Node>;
, but everywhere in the code IntelliSense thinks it's undefined.Steps to reproduce:
Expected behavior
I don't expect any of these errors/bugs/inaccuracies to be showing up, as the code compiles successfully and performs as I expect it to.
Code sample and Logs
boosttest.cpp
c_cpp_properties.json
Log Diagnostics
Screenshots
model
not recognizedpoint
not definedbox
not definedNodeRef
not definedSame block of code with SFML RenderTexture
rtree
,quadratic
not members ofboost::geometry::index