Giter VIP home page Giter VIP logo

Comments (4)

FuegoFro avatar FuegoFro commented on June 12, 2024

Looking into this a bit more, it seems that the parser doesn't understand the uniform initialization list that is initializing m_shutdown, instead thinking that we're in a method. It has code to look for assignment/initialization, so a workaround is to put an = before the initializer list like so:

atomic<bool> m_shutdown = { false };

But ideally the tool would be able to handle member initializations like this without modifying the source code.

from cppclean.

r-e-d avatar r-e-d commented on June 12, 2024

Thanks for the report. Your analysis is correct, the problem is caused by the uniform initialization. I will try to improve the parser to handle this construct.

from cppclean.

jguigui avatar jguigui commented on June 12, 2024

Hi,

Member initialization list for bool is still triggering a parser error (with cppclean 0.12). Any plan to fix it ?
Thanks,
Jean-Paul

from cppclean.

JPArroyo avatar JPArroyo commented on June 12, 2024

I'm hitting this with 0.12 as well

Traceback (most recent call last):
File "/usr/local/bin/cppclean", line 145, in
sys.exit(main())
File "/usr/local/bin/cppclean", line 120, in main
entire_ast = list([_f for _f in builder.generate() if _f])
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 651, in generate
result = self._generate_one(token)
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 675, in _generate_one
return method()
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 1177, in handle_class
return self._handle_class_and_struct(Class)
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 1174, in _handle_class_and_struct
return self._get_class(class_type, None)
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 1486, in _get_class
body = list(ast.generate())
File "/usr/local/lib/python2.7/dist-packages/cpp/ast.py", line 647, in generate
if self.namespaces.pop():
IndexError: pop from empty list

from cppclean.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.