diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index c4268760b38..b834a5809b9 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -968,8 +968,9 @@ QList GccToolChainFactory::autoDetectToolchains(const FileName &com if (compilerPath.isEmpty()) return result; - result = Utils::filtered(alreadyKnown, [requiredTypeId, compilerPath](ToolChain *tc) { - return tc->typeId() == requiredTypeId && tc->compilerCommand() == compilerPath; + result = Utils::filtered(alreadyKnown, [=](ToolChain *tc) { + return tc->typeId() == requiredTypeId && tc->compilerCommand() == compilerPath + && tc->language() == language; }); if (!result.isEmpty()) { for (ToolChain *tc : result) {