diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 3cf6cc82..d6ea0cdd 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -9,7 +9,15 @@ // Clang compiler setup. #define BOOST_HAS_PRAGMA_ONCE -#define BOOST_HAS_PRAGMA_DETECT_MISSMATCH + +// Detecting `-fms-extension` compiler flag assuming that _MSC_VER defined when that flag is used. +#if defined (_MSC_VER) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)) + // Ignoring the checks on APPLE platform because someone made __clang_major__ equal to + // LLVM version rather than compiler version. +# ifndef __APPLE__ +# define BOOST_HAS_PRAGMA_DETECT_MISSMATCH +# endif +#endif // When compiling with clang before __has_extension was defined, // even if one writes 'defined(__has_extension) && __has_extension(xxx)',