susantohendra / cppclean

Automatically exported from code.google.com/p/cppclean
0 stars 0 forks source link

operator> causes IndexError exception #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. have an operator> defined
2. Run find_warnings.py

What is the expected output? What do you see instead?
Parses stuff. Actually crashes, here is the error:
{{{
Processing test.h
Got exception in test.h @ Token('bool', 27, 31) []
Got exception in test.h @ Token('class', 0, 5) []
Traceback (most recent call last):
  File "/home/rich/src/cppclean-read-only/headers/cpp/find_warnings.py",
line 495, in <module>
    main(sys.argv)
  File "/home/rich/src/cppclean-read-only/headers/cpp/find_warnings.py",
line 488, in main
    entire_ast = list(filter(None, builder.Generate()))
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 719, in
Generate
    result = self._GenerateOne(token)
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 742, in
_GenerateOne
    return method()
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 1445,
in handle_class
    return self._GetClass(Class, VISIBILITY_PRIVATE, None)
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 1521,
in _GetClass
    body = list(ast.Generate())
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 719, in
Generate
    result = self._GenerateOne(token)
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 804, in
_GenerateOne
    return self._GetMethod(temp_tokens, 0, None, False)
  File "/home/rich/src/cppclean-read-only/headers/cpp/ast.py", line 976, in
_GetMethod
    while return_type_and_name[index].name != '<':
IndexError: list index out of range
}}}

What version of the product are you using? On what operating system?
svn version, r279

Please provide any additional information below.
Attached a minimal example.

Original issue reported on code.google.com by richard.quirk on 27 Dec 2008 at 8:30

Attachments: