diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index b50b9c466..932c7b44f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5004,12 +5004,14 @@ void Tokenizer::simplifyEnum() } tok1 = start; - while (tok1->next() && tok1->next() != end->next()) + while (tok1->next() && tok1->next() != end) tok1->deleteNext(); + tok1->deleteNext(); if (start != _tokens) { tok1 = start->previous(); tok1->deleteNext(); + tok = tok1; } else _tokens->deleteThis();