Comments (4)
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.
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.
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.
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)
- Python 3.7: RuntimeError: generator raised StopIteration HOT 3
- False-positive when using mixed folder separator style (backslash and forward slash). HOT 1
- "Exception while processing 'myheaderfile.hpp': unexpected token: Token(u'true', xxx, yyy)"
- parsing error: Token(u'#include <set>\\\n', xxx, yyy)
- parsing error: (Token(u'::', xxx, yyy), [], [Token(u'B', zzz, bbb)]) HOT 1
- False positive when includes are not together in the .cpp file. HOT 1
- Invalid "... not found in any directly included header" HOT 2
- Issue with include .hxx file
- which versions of C++ are supported? HOT 1
- Does this also support C or just C++?
- RuntimeError: generator raised StopIteration for a very simple code
- Y'all ever heard of paths having spaces?
- Do I use the program correctly? (Windows)
- 0.13: pytest is failing in 7 units HOT 1
- False positive : does not need to be #included with fields of structure
- False positive when calling a macro from within another macro
- Missing Feature ... WishList item
- False positive "should not #include C++ source file" for CMake's AUTOMOC files
- Create a new release from master
- Not finding operator overloading in the header file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppclean.