I think we need a workaround for a VS 2017 bug

23 views
Skip to first unread message

louis.j....@gmail.com

unread,
Jan 18, 2018, 10:55:54 AM1/18/18
to SVG++ library
Hello,

I'm trying to compile the full_parse_main program, but get an error at compile time. There may be more hidden underneath, but I can't see them until I clear this one.

The environments is as follows:

Running Windows 10 Enterprise version 1607, build 14393.1884. IT has relatively tight security on this. I am running from a directory specifically enabled for Read/Write/Execute operations without virus scanning or execution blocking.

Visual Studio 2017 version ID = 19.12.25831

Boost 1.66.0

I don't see a version of SVGPP, but I downloaded svgpp-master.zip on 12 Jan 2018 which I believe to be the latest version

compiler options are /permissive- /FR"Debug\" /GS /analyze- /Wall /Zc:wchar_t /I"../svgpp_test" /ZI /Gm- /Od /sdl /Fd"Debug\vc141.pdb" /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /FC /Fa"Debug\" /EHsc /Fo"Debug\" /Fp"Debug\SVGPP_test.pch" /diagnostics:classic

linker options don't apply as we never get that far.

The error occurs in module "misc.hpp" line 290

const qi::rule<iterator_t> rule = value % +detail::character_encoding_namespace::space;


The compiler return the following errors:


c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(290): error C3083: 'ascii': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(290): error C2039: 'space': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2065: 'space': undeclared identifier


They occur twice, so I'm assuming this is instantiated twice

Line 269 is the top of the structure

I believe these to all be related to the same thing, and therefore, constitute one error.


The crazy thing about this, and which leads me to believe this is a compiler bug is that within the editor, you can hover over the code in question and it knows the values and the correct memberships.


I've spent the last couple of days playing with different means of correcting this. Its as if the compiler doesn't understand that svgpp::detail has been initialized, in particular the character_encoding_namespace member of details.


for debugging purposes, I've created namespace variables and then tried to assign to them and use them:


The new line 290: (modified file)

290: namespace cem1 = boost;

291: namespace cem2 = boost::spirit;

292: namespace cem3 = boost::spirit::ascii;

293: namespace cem4 = detail;

294: namespace cem5 = detail::boost;

295: namespace cem6 = detail::boost::spirit;

296: namespace cem7 = detail::boost::spirit::ascii;

297: namespace cem8 = svgpp;

298: namespace cem9 = svgpp::detail;

299: namespace cem10 = svgpp::detail::boost;

300: namespace cem11 = svgpp::detail::boost::spirit;

301: namespace cem12 = svgpp::detail::boost::spirit::ascii;


303: const qi::rule<iterator_t> rule1 = value % +cem1::spirit::ascii::space;

304: const qi::rule<iterator_t> rule2 = value % +cem2::ascii::space;

305: const qi::rule<iterator_t> rule3 = value % +cem3::space;

306: const qi::rule<iterator_t> rule4 = value % +cem4::boost::spirit::ascii::space;

307: const qi::rule<iterator_t> rule5 = value % +cem5::spirit::ascii::space;

308: const qi::rule<iterator_t> rule6 = value % +cem6::ascii::space;

309: const qi::rule<iterator_t> rule7 = value % +cem7::space;

310: const qi::rule<iterator_t> rule8 = value % +cem8::detail::boost::spirit::ascii::space;

311: const qi::rule<iterator_t> rule9 = value % +cem9::boost::spirit::ascii::space;

312: const qi::rule<iterator_t> rule10 = value % +cem10::spirit::ascii::space;

313: const qi::rule<iterator_t> rule11 = value % +cem11::ascii::space;

314: const qi::rule<iterator_t> rule12 = value % +cem12::space;


The relevant errors extracted from the error log file are:


c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(294): error C2039: 'boost': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(295): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(295): error C2039: 'spirit': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2878: 'spirit': a namespace or class of this name does not exist
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(296): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(296): error C3083: 'spirit': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(296): error C2039: 'ascii': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2878: 'ascii': a namespace or class of this name does not exist
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(299): error C2039: 'boost': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(300): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(300): error C2039: 'spirit': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(301): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(301): error C3083: 'spirit': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(301): error C2039: 'ascii': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(306): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(306): error C3083: 'spirit': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(306): error C3083: 'ascii': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(306): error C2039: 'space': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2065: 'space': undeclared identifier
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2653: 'cem6': is not a class or namespace name
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(308): error C2065: 'space': undeclared identifier
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2653: 'cem7': is not a class or namespace name
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(309): error C2065: 'space': undeclared identifier
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(310): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(310): error C3083: 'spirit': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(310): error C3083: 'ascii': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(310): error C2039: 'space': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(311): error C3083: 'boost': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(311): error C3083: 'spirit': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(311): error C3083: 'ascii': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(311): error C2039: 'space': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2653: 'cem11': is not a class or namespace name
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(313): error C2065: 'space': undeclared identifier
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(269): error C2653: 'cem12': is not a class or namespace name
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(314): error C2065: 'space': undeclared identifier
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(316): error C3083: 'ascii': the symbol to the left of a '::' must be a type
c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\parser\misc.hpp(316): error C2039: 'space': is not a member of 'svgpp::detail'
  c:\users\johnsolo\source\svgpp_test\svgpp_test\svgpp\document_traversal.hpp(38): note: see declaration of 'svgpp::detail'


This list appears twice in the error log

Note that line 316 refers to the original attempt to establish the rule, or line 290 in the unmodified file


Given what worked and what didn't. it is obvious that, as expected, boost, spirit and ascii are not members of svgpp::detail or sgvpp

Other tests like this which I have performed indicate that character_encoding_namespace is not a member of detail or uninitialized at the time this code is compiled.


The compiler appears to be dropping anything character_encoding_namespace was referencing leaving the expanded variable to be accessed as detail::space.

space is obviously not a member of detail.


This then begs the question: Why isn't character_encoding_namespace a member of detail, or if it is, why isn't it initialized to boost::spirit::ascii ?

I don't really have the means or understanding to determine which of the two questions is relevant to the debug process.


Remember that tooltips gets it right, so the online parser understands the correct relationship. The regular compiler doesn't. I'm also keeping in mind that many others have successfully compiled this using other compilers and earlier versions of MSVC.


Given that I don't code often, I need help resolving this.


Regards,


Louis Johnson

Reply all
Reply to author
Forward
0 new messages