From 194bde265c9c207052f1039c54cf9d6cb32703c8 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 21 Nov 2017 12:18:28 +0100 Subject: Clang: Define __FUNCSIG__ and others for msvc toolchain Affects __FUNCSIG__, __FUNCTION__ and __FUNCDNAME__. By default Clang can't concatenate strings under those macros with other strings. Because of that we need to define them with empty strings to make clang compile such cases without errors. Task-number: QTCREATORBUG-19295 Change-Id: I9a3770ebe56b4b8a49ba9982c5a1ba90c8f0b304 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/compileroptionsbuilder.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp') diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 88a85e17cd..914973bc44 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -339,6 +339,12 @@ void CompilerOptionsBuilder::undefineCppLanguageFeatureMacrosForMsvc2015() } } +void CompilerOptionsBuilder::addDefineFunctionMacrosMsvc() +{ + if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) + addMacros({{"__FUNCSIG__", "\"\""}, {"__FUNCTION__", "\"\""}, {"__FUNCDNAME__", "\"\""}}); +} + void CompilerOptionsBuilder::addDefineFloat128ForMingw() { // CLANG-UPGRADE-CHECK: Workaround still needed? -- cgit v1.2.1