From f8cbe5d453e845901e14a971a8ca5dcb808df0c6 Mon Sep 17 00:00:00 2001 From: Golubchikov Mihail Date: Fri, 14 Feb 2020 10:27:53 +0300 Subject: [PATCH] Fix issue 'Index out of range #140' get_name() can return an empty list, see comment https://github.com/myint/cppclean/issues/140#issuecomment-520799414 --- cpp/ast.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/ast.py b/cpp/ast.py index 1fbdc30..1348db1 100644 --- a/cpp/ast.py +++ b/cpp/ast.py @@ -1095,6 +1095,8 @@ def _get_method(self, return_type_and_name, modifiers, templated_types, token = self._get_next_token() continue member, token = self.get_name() + if not member: + continue member = member[0] if token.name == '(' or token.name == '{': end = '}' if token.name == '{' else ')'