codinuum / cca

Code Continuity Analysis Framework
https://codinuum.github.io/gallery-cca/
Apache License 2.0
20 stars 5 forks source link

[cpp] failed parsing #39

Closed petr-bauch closed 2 months ago

petr-bauch commented 3 months ago

Hi,

we discovered a few more cases where the C++ parser fails:

  1. sizeof( x == 1 ); even though sizeof (1 == x); works fine
  2. static char buf[ (((4))) ]; in global scope
  3. struct S s = { .data = (uint8_t[(3)]){ 1, 2, 3, }, };
  4. Struct_t s[3] = (Struct_t[]){ 1,2,3 };
codinuum commented 3 months ago

Thank you for reporting. We have just fixed the parser. The commit 50fecfb should work for you.

petr-bauch commented 3 months ago

Thank you for the quick fix.

Is it possible it introduced a regression for https://github.com/taskflow/taskflow/blob/9823d00e119b2205943de737b9ca5f93c5cc26bd/3rd-party/ff/dnode.hpp#L235 ? At least with -dump:ast it seems to fail to parse.

codinuum commented 3 months ago

We have pushed another fix (e82ab9b). At least the code above should be parsed.