pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.43k stars 2.17k forks source link

PocoDoc not parsing :: correctly #4246

Open vrabac6 opened 1 year ago

vrabac6 commented 1 year ago

While generating documentation for project that I'm working on using PocoDoc I faced with this issue.

Application: [Error] Assertion violation: pos < name.length() in file "src/NameSpace.cpp", line 228
...
Application: [Information] 1 errors.

In the file that is analyzed by PocoDoc this line of code is forcing PocoDoc to fail with assertion error in splitName method.

 unsigned char wd_    :  4;

After reviewing values right before assertion errors using Debugger
PocoDoc_debugger

Previous line of code has been processed by CppParser and has become:

unsigned char wd_ :4;

Case when : is second to last character in the string will always cause assertion error in PocoDoc.

I propose this change in the method instead of: std::string::size_type pos = name.find(':'); into: std::string::size_type pos = name.find("::");

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 365 days with no activity.