PC-Lint reports errors for VC6-specific implementation in is_same.hpp

Hi all, Since I have included boost\dynamic_bitset.hpp in my project, PC-Lint reports many thousands of redefinitions of symbol 'is_same_part_1<<1>>::part_2<<1>> for the following code in type_traits\is_same.hpp. #ifdef BOOST_MSVC // the following VC6 specific implementation is *NOT* legal // C++, but has the advantage that it works for incomplete // types. template< typename T1 > struct is_same_part_1 { template<typename T2> struct part_2 { enum { value = false }; }; template<> struct part_2<T1> { enum { value = true }; }; }; If I replace #ifdef BOOST_MSVC with #if (defined BOOST_MSVC) && (BOOST_MSVC < 1300) The code compiles with Visual Studio .NET 2003 and PC-Lint doesn't report any error. Stefan Felkel

"stefan_felkel2000"
Hi all,
Since I have included boost\dynamic_bitset.hpp in my project, PC-Lint reports many thousands of redefinitions of symbol 'is_same_part_1<<1>>::part_2<<1>> for the following code in type_traits\is_same.hpp.
#ifdef BOOST_MSVC // the following VC6 specific implementation is *NOT* legal // C++, but has the advantage that it works for incomplete // types.
template< typename T1 > struct is_same_part_1 { template<typename T2> struct part_2 { enum { value = false }; }; template<> struct part_2<T1> { enum { value = true }; }; };
If I replace
#ifdef BOOST_MSVC
with
#if (defined BOOST_MSVC) && (BOOST_MSVC < 1300)
The code compiles with Visual Studio .NET 2003 and PC-Lint doesn't report any error.
This is an odd request, since Visual Studio .NET 2003 never compiles that part of the file as BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is not defined for VC7.1. To make PC-Lint happy I was going to check in a patch, but then it occurred to me: this code *is* nonconforming, so a lint tool *should* complain when it's encountered. So I guess the question is: why is your PC-Lint not configured to emulate your VC7.1 compiler? If it was, it would never see that code either. -- Dave Abrahams Boost Consulting www.boost-consulting.com

--- In Boost-Users@yahoogroups.com, David Abrahams
This is an odd request, since Visual Studio .NET 2003 never compiles that part of the file as BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is not defined for VC7.1. To make PC-Lint happy I was going to check in a patch, but then it occurred to me: this code *is* nonconforming, so a lint tool *should* complain when it's encountered. So I guess the question is: why is your PC-Lint not configured to emulate your VC7.1 compiler? If it was, it would never see that code either.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Sorry, it was my fault - _MSC_VER was 1300 instead of 1310 and so BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION was defined. Stefan Felkel
participants (2)
-
David Abrahams
-
stefan_felkel2000