parent
81f9b9b2b7
commit
b4df064875
|
@ -7516,7 +7516,7 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, const Token * const tokEnd, co
|
|||
}
|
||||
|
||||
while (Token::Match(varName, "%type% %type%")) {
|
||||
if (varName->str() != "const") {
|
||||
if (varName->str() != "const" && varName->str() != "volatile") {
|
||||
++typelen;
|
||||
}
|
||||
varName = varName->next();
|
||||
|
|
|
@ -2526,6 +2526,7 @@ private:
|
|||
}
|
||||
|
||||
void volatile_variables() {
|
||||
{
|
||||
const char code[] = "volatile int a=0;\n"
|
||||
"volatile int b=0;\n"
|
||||
"volatile int c=0;\n";
|
||||
|
@ -2534,6 +2535,14 @@ private:
|
|||
|
||||
ASSERT_EQUALS("volatile int a ; a = 0 ;\nvolatile int b ; b = 0 ;\nvolatile int c ; c = 0 ;", actual);
|
||||
}
|
||||
{
|
||||
const char code[] = "char *volatile s1, *volatile s2;\n"; // #11004
|
||||
|
||||
const std::string actual(tokenizeAndStringify(code));
|
||||
|
||||
ASSERT_EQUALS("char * volatile s1 ; char * volatile s2 ;", actual);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void simplifyKeyword() {
|
||||
|
|
Loading…
Reference in New Issue