parent
d2546d5252
commit
a6b0129725
|
@ -4757,7 +4757,8 @@ void Tokenizer::setVarIdPass1()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scopeStack.top().isEnum || !(Token::Match(tok->previous(), "{|,") && Token::Match(tok->next(), ",|=|}"))) {
|
if ((!scopeStack.top().isEnum || !(Token::Match(tok->previous(), "{|,") && Token::Match(tok->next(), ",|=|}"))) &&
|
||||||
|
!Token::simpleMatch(tok->next(), ": ;")) {
|
||||||
const std::map<std::string, nonneg int>::const_iterator it = variableMap.map(globalNamespace).find(tok->str());
|
const std::map<std::string, nonneg int>::const_iterator it = variableMap.map(globalNamespace).find(tok->str());
|
||||||
if (it != variableMap.map(globalNamespace).end()) {
|
if (it != variableMap.map(globalNamespace).end()) {
|
||||||
tok->varId(it->second);
|
tok->varId(it->second);
|
||||||
|
|
|
@ -2785,6 +2785,17 @@ private:
|
||||||
" break;\n"
|
" break;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}", "test.c"));
|
"}", "test.c"));
|
||||||
|
|
||||||
|
ASSERT_EQUALS("1: int * f ( ) {\n" // #11838
|
||||||
|
"2: int * label@1 ; label@1 = 0 ;\n"
|
||||||
|
"3: label : ;\n"
|
||||||
|
"4: return label@1 ;\n"
|
||||||
|
"5: }\n",
|
||||||
|
tokenize("int* f() {\n"
|
||||||
|
" int* label = 0;\n"
|
||||||
|
"label:\n"
|
||||||
|
" return label;\n"
|
||||||
|
"}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void varid_structinit() { // #6406
|
void varid_structinit() { // #6406
|
||||||
|
|
Loading…
Reference in New Issue