loplugin:implicitboolconversion: Filter out bool -> std::atomic<bool>
...as used since patch set 8 of <https://gerrit.libreoffice.org/#/c/81542/8> "WIP: tdf#120006 New Document converter" Change-Id: I79c2237a2e5839162272c0d49bdb4d87c9e35102 Reviewed-on: https://gerrit.libreoffice.org/83655 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -1020,6 +1020,19 @@ void ImplicitBoolConversion::checkCXXConstructExpr(
|
||||
|
||||
void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) {
|
||||
if (compiler.getLangOpts().CPlusPlus) {
|
||||
if (expr->getCastKind() == CK_ConstructorConversion) {
|
||||
auto const t1 = expr->getType();
|
||||
if (auto const t2 = t1->getAs<TemplateSpecializationType>()) {
|
||||
assert(t2->getNumArgs() >= 1);
|
||||
auto const a = t2->getArg(0);
|
||||
if (a.getKind() == TemplateArgument::Type && a.getAsType()->isBooleanType()
|
||||
&& (loplugin::TypeCheck(t1).TemplateSpecializationClass()
|
||||
.ClassOrStruct("atomic").StdNamespace()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"implicit conversion (%0) from %1 to %2", compat::getBeginLoc(expr))
|
||||
|
Reference in New Issue
Block a user