summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/pp-engine.cpp
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-09 13:33:27 +0200
committerAleix Pol Gonzalez <aleixpol@kde.org>2015-10-09 17:09:45 +0000
commitb899684a89b2c6880cf346b3ea24d5705fdf42ff (patch)
treec1deb0386adb472adc460fea602bf30872ed967f /src/libs/cplusplus/pp-engine.cpp
parent954cabdde87dde25eb88b6dcf8b9352f2e37da13 (diff)
downloadqt-creator-b899684a89b2c6880cf346b3ea24d5705fdf42ff.tar.gz
Don't put QString in static attributes
It crashed in some places on our code-base due to the so-called "static initialization order fiasco". As a solution, it turns the variable into a function. This shouldn't have a penalty due to QStringLiteral. Change-Id: I9f8a955afdff878dc2f0db16fec861d81250c243 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
-rw-r--r--src/libs/cplusplus/pp-engine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index 93a6e451b4..0e197f475d 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -734,7 +734,7 @@ void Preprocessor::State::updateIncludeGuardState_helper(IncludeGuardStateHint h
#endif // DEBUG_INCLUDE_GUARD_TRACKING
}
-const QString Preprocessor::configurationFileName = QLatin1String("<configuration>");
+QString Preprocessor::configurationFileName() { return QStringLiteral("<configuration>"); }
Preprocessor::Preprocessor(Client *client, Environment *env)
: m_client(client)
@@ -1978,7 +1978,7 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
// the macro is a feature constraint(e.g. QT_NO_XXX)
if (checkUndefined && macroName.startsWith("QT_NO_")) {
- if (macro->fileName() == configurationFileName) {
+ if (macro->fileName() == configurationFileName()) {
// and it' defined in a pro file (e.g. DEFINES += QT_NO_QOBJECT)
value = false; // take the branch