aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2017-10-03 11:11:35 +0100
committerSergio Martins <iamsergio@gmail.com>2017-10-03 11:12:43 +0100
commitf3229edff7232b52523ca3bec34c84dfe907e45c (patch)
tree6a7dfc401b9fb28b023e0226054519890cfefda5 /src
parentb843957a8dd3fc24ecdaae0289d976a08a0e6958 (diff)
qstring-allocations: Don't warn during bootstrap
Too many false positives due to QString::fromLatin1() being used instead tr().
Diffstat (limited to 'src')
-rw-r--r--src/checks/level2/qstring-allocations.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/checks/level2/qstring-allocations.cpp b/src/checks/level2/qstring-allocations.cpp
index 1ff1fcf4..42b3c22b 100644
--- a/src/checks/level2/qstring-allocations.cpp
+++ b/src/checks/level2/qstring-allocations.cpp
@@ -29,6 +29,7 @@
#include "StringUtils.h"
#include "FixItUtils.h"
#include "FunctionUtils.h"
+#include "QtUtils.h"
#include "checkmanager.h"
#include <clang/AST/DeclCXX.h>
@@ -69,6 +70,12 @@ QStringAllocations::QStringAllocations(const std::string &name, ClazyContext *co
void QStringAllocations::VisitStmt(clang::Stmt *stm)
{
+ if (QtUtils::isBootstrapping(m_preprocessorOpts)) {
+ // During bootstrap many QString::fromLatin1() are used instead of tr(), which causes
+ // much noise
+ return;
+ }
+
VisitCtor(stm);
VisitOperatorCall(stm);
VisitFromLatin1OrUtf8(stm);