Skip to content

Commit

Permalink
Ignore static_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
r-e-d committed Jul 21, 2015
1 parent fd23163 commit ba20ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,11 @@ def _generate_one(self, token):

temp_tokens.insert(0, token)
if last_token.name == '(' or last_token.name == '{':
# Ignore static_assert
if temp_tokens[-1].name == 'static_assert':
self._ignore_up_to(';')
return None

# If there is an assignment before the paren,
# this is an expression, not a method.
for i, elt in reversed(list(enumerate(temp_tokens))):
Expand Down
3 changes: 3 additions & 0 deletions test/foo.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,6 @@ class Resource
{
};
};

static_assert(21 < 42, "");

0 comments on commit ba20ade

Please sign in to comment.