Clang: Stop enabling exceptions explicitly

According to commit e2e3be09e3 this was
needed for clang 3.8.0 on Windows.

Change-Id: I4f2c2bf31449d9613607e57524c7ff6e4577812a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-01-08 15:57:53 +01:00
parent 336a3c14c0
commit b114f77d8a
3 changed files with 2 additions and 28 deletions

View File

@@ -112,7 +112,6 @@ QStringList CompilerOptionsBuilder::build(ProjectFile::Kind fileKind,
updateLanguageOption(fileKind);
addOptionsForLanguage(/*checkForBorlandExtensions*/ true);
enableExceptions();
addToolchainAndProjectMacros();
undefineClangVersionMacrosForMsvc();
@@ -215,13 +214,6 @@ void CompilerOptionsBuilder::addExtraCodeModelFlags()
m_options.append(m_projectPart.extraCodeModelFlags);
}
void CompilerOptionsBuilder::enableExceptions()
{
if (m_projectPart.languageVersion > ProjectExplorer::LanguageVersion::LatestC)
add("-fcxx-exceptions");
add("-fexceptions");
}
static QString creatorResourcePath()
{
#ifndef UNIT_TESTS

View File

@@ -61,7 +61,6 @@ public:
void addTargetTriple();
void addExtraCodeModelFlags();
void enableExceptions();
void insertWrappedQtHeaders();
void addOptionsForLanguage(bool checkForBorlandExtensions = true);
void updateLanguageOption(ProjectFile::Kind fileKind);

View File

@@ -355,22 +355,6 @@ TEST_F(CompilerOptionsBuilder, AddTargetTriple)
ASSERT_THAT(compilerOptionsBuilder.options(), ElementsAre("-target", "x86_64-apple-darwin10"));
}
TEST_F(CompilerOptionsBuilder, EnableCExceptions)
{
projectPart.languageVersion = ProjectExplorer::LanguageVersion::C99;
compilerOptionsBuilder.enableExceptions();
ASSERT_THAT(compilerOptionsBuilder.options(), ElementsAre("-fexceptions"));
}
TEST_F(CompilerOptionsBuilder, EnableCXXExceptions)
{
compilerOptionsBuilder.enableExceptions();
ASSERT_THAT(compilerOptionsBuilder.options(), ElementsAre("-fcxx-exceptions", "-fexceptions"));
}
TEST_F(CompilerOptionsBuilder, InsertWrappedQtHeaders)
{
compilerOptionsBuilder.insertWrappedQtHeaders();
@@ -457,9 +441,8 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptions)
ASSERT_THAT(compilerOptionsBuilder.options(),
ElementsAre(
"-nostdlibinc", "-c", "-m64", "-target", "x86_64-apple-darwin10",
"-arch", "x86_64", "-x", "c++", "-std=c++17", "-fcxx-exceptions",
"-fexceptions", "-Dfoo=bar", "-DprojectFoo=projectBar",
"-undef",
"-arch", "x86_64", "-x", "c++", "-std=c++17", "-Dfoo=bar",
"-DprojectFoo=projectBar", "-undef",
"-I", IsPartOfHeader("wrappedQtHeaders"),
"-I", IsPartOfHeader(QDir::toNativeSeparators("wrappedQtHeaders/QtCore").toStdString()),
"-I", QDir::toNativeSeparators("/tmp/path"),