enabled and mitigated `-Wunreachable-code` Clang warnings (#4818)
This commit is contained in:
parent
634881db61
commit
a250e6b569
|
@ -91,7 +91,6 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|||
add_compile_options_safe(-Wno-double-promotion)
|
||||
add_compile_options_safe(-Wno-shadow-field)
|
||||
add_compile_options_safe(-Wno-shadow-uncaptured-local)
|
||||
add_compile_options_safe(-Wno-unreachable-code)
|
||||
add_compile_options_safe(-Wno-implicit-float-conversion)
|
||||
add_compile_options_safe(-Wno-switch-enum)
|
||||
add_compile_options_safe(-Wno-float-conversion)
|
||||
|
|
|
@ -2857,10 +2857,8 @@ void CheckClass::checkCopyCtorAndEqOperator()
|
|||
{
|
||||
// This is disabled because of #8388
|
||||
// The message must be clarified. How is the behaviour different?
|
||||
return;
|
||||
|
||||
// cppcheck-suppress unreachableCode - remove when code is enabled again
|
||||
if (!mSettings->severity.isEnabled(Severity::warning))
|
||||
if ((true) || !mSettings->severity.isEnabled(Severity::warning))
|
||||
return;
|
||||
|
||||
for (const Scope * scope : mSymbolDatabase->classAndStructScopes) {
|
||||
|
|
|
@ -1747,7 +1747,7 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
|
|||
// function returning function pointer? '... ( ... %name% ( ... ))( ... ) {'
|
||||
// function returning reference to array '... ( & %name% ( ... ))[ ... ] {'
|
||||
// TODO: Activate this again
|
||||
if (false && tok->str() == "(" && tok->strAt(1) != "*" &&
|
||||
if ((false) && tok->str() == "(" && tok->strAt(1) != "*" &&
|
||||
(tok->link()->previous()->str() == ")" || Token::simpleMatch(tok->link()->tokAt(-2), ") const"))) {
|
||||
const Token* tok2 = tok->link()->next();
|
||||
if (tok2 && tok2->str() == "(" && Token::Match(tok2->link()->next(), "{|;|const|=")) {
|
||||
|
|
Loading…
Reference in New Issue