parent
b3016f01a1
commit
043f4fa621
|
@ -665,7 +665,7 @@ namespace {
|
|||
}
|
||||
|
||||
for (Token* type = start; Token::Match(type, "%name%|*|&"); type = type->next()) {
|
||||
if (Token::Match(type, "%name% ;")) {
|
||||
if (Token::Match(type, "%name% ;") && !type->isStandardType()) {
|
||||
mRangeType.first = start;
|
||||
mRangeType.second = type;
|
||||
mNameToken = type;
|
||||
|
|
|
@ -3277,7 +3277,8 @@ private:
|
|||
ASSERT_EQUALS("struct X { } ; std :: vector < X > v ;", tok(code));
|
||||
}
|
||||
|
||||
void simplifyTypedef145() { // #11634
|
||||
void simplifyTypedef145() {
|
||||
// #11634
|
||||
const char* code{};
|
||||
code = "int typedef i;\n"
|
||||
"i main() {}\n";
|
||||
|
@ -3292,6 +3293,11 @@ private:
|
|||
code = "struct {} typedef S;\n" // don't crash
|
||||
"S();\n";
|
||||
ASSERT_EQUALS("struct S { } ; struct S ( ) ;", tok(code));
|
||||
|
||||
// #11693
|
||||
code = "typedef unsigned char unsigned char;\n" // don't hang
|
||||
"void f(char);\n";
|
||||
ASSERT_EQUALS("void f ( char ) ;", tok(code));
|
||||
}
|
||||
|
||||
void simplifyTypedefFunction1() {
|
||||
|
|
Loading…
Reference in New Issue