diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index 7784a6d11..3c496ede1 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -212,7 +212,7 @@ bool TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(const Token *toke } if (level > 0) { errorToken=tok; - return true; + return true; } } } diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 97cdb4834..5441695e4 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7520,7 +7520,7 @@ void Tokenizer::simplifyEnum() break; if (Token::Match(temp, "class|struct")) temp = temp->next(); - if (!temp) + if (!temp) break; if (!Token::Match(temp, "[{:]") && (!temp->isName() || !Token::Match(temp->next(), "[{:;]"))) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 86768d4f9..589791498 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -88,8 +88,8 @@ private: TEST_CASE(garbageCode47); // #6706 TEST_CASE(garbageCode48); // #6712 TEST_CASE(garbageCode49); // #6715 - TEST_CASE(garbageCode50); // #6718 - TEST_CASE(garbageCode51); // #6719 + TEST_CASE(garbageCode50); // #6718 + TEST_CASE(garbageCode51); // #6719 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); @@ -507,11 +507,11 @@ private: ASSERT_THROW(checkCode(" ( ( ) ) { } ( { ( __builtin_va_arg_pack ( ) ) ; } ) { ( int { ( ) ( ( ) ) } ( ) { } ( ) ) += ( ) }"), InternalError); } - void garbageCode50() { // #6718 + void garbageCode50() { // #6718 checkCode(" enum struct"); } - void garbageCode51() { // #6719 + void garbageCode51() { // #6719 checkCode(" (const \"C\" ...); struct base { int f2; base (int arg1, int arg2); }; global_base(0x55, 0xff); { ((global_base.f1 0x55) (global_base.f2 0xff)) { } } base::base(int arg1, int arg2) { f2 = }"); }