C++: Support negative enum values

Change-Id: I93dac08a62be467918dbc9f72239d34191a81fd6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-12-06 15:25:26 +02:00
committed by Orgad Shaneh
parent 4dd4b180f3
commit ebf26ca125
2 changed files with 28 additions and 1 deletions

View File

@@ -468,7 +468,10 @@ bool isInteger(const StringLiteral *stringLiteral)
{
const int size = stringLiteral->size();
const char *chars = stringLiteral->chars();
for (int i = 0; i < size; ++i) {
int i = 0;
if (chars[i] == '-')
++i;
for (; i < size; ++i) {
if (!isdigit(chars[i]))
return false;
}