Fixed fix for #7042 - support hexadecimal digits

This commit is contained in:
PKEuS 2015-10-18 16:37:33 +02:00
parent 7112725d38
commit 52be380ef0
2 changed files with 5 additions and 3 deletions

View File

@ -662,7 +662,7 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
}
// C++14 digit separators
if (ch == '\'' && std::isdigit(previous))
if (ch == '\'' && std::isxdigit(previous))
; // Just skip it.
// String or char constants..

View File

@ -338,8 +338,10 @@ private:
}
void readCode5() {
const char code[] = "int i = 0x1000'00;";
ASSERT_EQUALS("int i = 0x100000;", preprocessorRead(code));
ASSERT_EQUALS("int i = 0x100000;", preprocessorRead("int i = 0x1000'00;"));
ASSERT_EQUALS("", errout.str());
ASSERT_EQUALS("int i = 0x0F0FFFFF;", preprocessorRead("int i = 0x0F0F'FFFF;"));
ASSERT_EQUALS("", errout.str());
}