Skip to content

AST error parsing use of macro defining throw() #58

@JasonMarechal

Description

@JasonMarechal

Parsing the following piece of code throw an exeption because of the use of MY_THROW() :

#define MY_THROW() throw ()
void Foo() MY_THROW() {}

The callstack of the exception being :

PS cppclean> python3 .\cppclean .\Test --verbose
Processing .\Test\Headers\AbstractProperty.h
Got exception in .\Test\Headers\AbstractProperty.h @ Token('void', 29, 33) []
Traceback (most recent call last):
  File ".\cppclean", line 130, in <module>
    sys.exit(main())
  File ".\cppclean", line 112, in main
    entire_ast = list([_f for _f in builder.generate() if _f])
  File ".\cppclean", line 112, in <listcomp>
    entire_ast = list([_f for _f in builder.generate() if _f])
  File "cppclean\cpp\ast.py", line 709, in generate
    result = self._generate_one(token)
  File "cppclean\cpp\ast.py", line 798, in _generate_one
    return self._get_method(temp_tokens, 0, None, False)
  File "cppclean\cpp\ast.py", line 1089, in _get_method
    if parameters[0].name == '*':
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions