summaryrefslogtreecommitdiff
path: root/src/qdoc/text.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-12-01 15:08:47 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-12-02 12:47:53 +0100
commit1ce71d77409bf8ea962444b59b9e5e7b5b98b188 (patch)
treef2fc74e92a789dcacb01d69cc3da2eb86681d767 /src/qdoc/text.cpp
parent11c9f677a9880bb0456d7796dfd2518b1396add3 (diff)
downloadqttools-1ce71d77409bf8ea962444b59b9e5e7b5b98b188.tar.gz
qdoc: Fix clang warnings about temporary QRegularExpression objects
Pick-to: 6.4 Change-Id: I0d6c597552103251a8c09418d83ea2e38ed10012 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/text.cpp')
-rw-r--r--src/qdoc/text.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qdoc/text.cpp b/src/qdoc/text.cpp
index 7c526ad1f..387883109 100644
--- a/src/qdoc/text.cpp
+++ b/src/qdoc/text.cpp
@@ -234,7 +234,8 @@ void Text::dump() const
str.replace("\\", "\\\\");
str.replace("\"", "\\\"");
str.replace("\n", "\\n");
- str.replace(QRegularExpression(R"([^ -~])"), "?");
+ static const QRegularExpression re(R"([^ -~])");
+ str.replace(re, "?");
if (!str.isEmpty())
str = " \"" + str + QLatin1Char('"');