Closed ilatypov closed 2 years ago
Never mind, an upcoming release of the analyzer will mimic MSVC fully in this regard.
Could this issue still be addressed? Because the current code for MSVC is ill-formed, and thus not accepted by clang-cl (see llvm/llvm-project#63217).
MSVC-like compilers fail to process the older definitions
BOOST_BIMAP_MAP_VIEW_BASE_FRIEND
andBOOST_BIMAP_SET_VIEW_BASE_FRIEND
but are forced into them by checks of theBOOST_MSVC
auto-detected define.Depending on the compiler, Boost defines the above macros to expand into an appropriate form of a friend class declaration. It has to sense the compiler because MSVC did not accept an instance of a template class as a friend "right away".
MSVC needed an additional typedef to make that work.
One clang-based static analyzer mimics MSVC in many aspects but does not agree with the Boost work-around. It rejects the above Boost's work-around for MSVC because usage of a
typedef
-ed class name is not taking theclass
specifier.I therefore suggest limiting the older friend class declaration to the older MSVC versions,
Alternatively, the
typedef
-ed name of kindtplinstclass
can be used without theclass
specifier, that is, asfriend tplinstclass
in the existing BOOST_MSVC branch of the macro definitions. But this may break builds of Boost consumers with older MSVC compilers because those builds are unlikely to be tested with the change.