forked from qt-creator/qt-creator
Toolchains: Add C++98 as a language standard.
This was curiously missing from the CompilerFlag enum, so e.g. setting "QMAKE_CXXFLAGS += -std=c++98" in a .pro file did not have the desired effect on higher-level code such as the code model. Change-Id: Ia4323b699a2ccea9d3cbde10b05affe87d955277 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -86,6 +86,8 @@ void ProjectPart::evaluateToolchain(const ToolChain *tc,
|
||||
languageVersion = CXX14;
|
||||
else if (flags & ToolChain::StandardCxx11)
|
||||
languageVersion = CXX11;
|
||||
else if (flags & ToolChain::StandardCxx98)
|
||||
languageVersion = CXX98;
|
||||
else
|
||||
languageVersion = CXX11;
|
||||
|
||||
|
@@ -448,6 +448,7 @@ ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags
|
||||
const QByteArray std = flag.mid(5).toLatin1();
|
||||
if (std == "c++98" || std == "c++03") {
|
||||
flags &= ~CompilerFlags(StandardCxx11 | StandardCxx14 | StandardCxx17 | GnuExtensions);
|
||||
flags |= StandardCxx98;
|
||||
} else if (std == "gnu++98" || std == "gnu++03") {
|
||||
flags &= ~CompilerFlags(StandardCxx11 | StandardCxx14 | StandardCxx17);
|
||||
flags |= GnuExtensions;
|
||||
|
@@ -101,7 +101,8 @@ public:
|
||||
OpenMP = 0x40,
|
||||
ObjectiveC = 0x80,
|
||||
StandardCxx14 = 0x100,
|
||||
StandardCxx17 = 0x200
|
||||
StandardCxx17 = 0x200,
|
||||
StandardCxx98 = 0x400,
|
||||
};
|
||||
Q_DECLARE_FLAGS(CompilerFlags, CompilerFlag)
|
||||
|
||||
|
Reference in New Issue
Block a user