aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Martins <iamsergio@gmail.com>2019-04-23 18:35:05 +0100
committerSergio Martins <iamsergio@gmail.com>2019-04-23 18:35:46 +0100
commitd6e7f4c8ed6303cf471a13051aef1871a57c9692 (patch)
treee58f254b1271f972d889cd35dfe6e30183444a9d
parenta96b19e255665fc6429212102d40b3f69eb6ed79 (diff)
qstring-allocations: Don't warn for ui_*h files
they are auto-generated BUG: 406799
-rw-r--r--src/checks/level2/qstring-allocations.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/checks/level2/qstring-allocations.cpp b/src/checks/level2/qstring-allocations.cpp
index 34c0baf1..0b88f074 100644
--- a/src/checks/level2/qstring-allocations.cpp
+++ b/src/checks/level2/qstring-allocations.cpp
@@ -599,5 +599,11 @@ void QStringAllocations::VisitAssignOperatorQLatin1String(Stmt *stmt)
void QStringAllocations::maybeEmitWarning(SourceLocation loc, string error, const std::vector<FixItHint> &fixits)
{
+ if (clazy::isUIFile(loc, sm())) {
+ // Don't bother warning for generated UI files.
+ // We do the check here instead of at the beginning so users that don't use UI files don't have to pay the performance price.
+ return;
+ }
+
emitWarning(loc, error, fixits);
}