]> granicus.if.org Git - clang/commitdiff
Claim compatibility with VS 2012 by default
authorReid Kleckner <reid@kleckner.net>
Wed, 18 Sep 2013 00:33:59 +0000 (00:33 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 18 Sep 2013 00:33:59 +0000 (00:33 +0000)
This will define _MSC_VER to 1700 by default and avoid linker errors
from /failifmismatch linker directives in the C++ standard headers.

Most people trying out the Visual Studio integration are using 2012,
since that's the only version that clang-format works with.  This way
they don't have to pass funky -Xclang -fmsc-version=1700 flags just to
link against the standard C++ runtime.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190908 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 3dde81c5970dce641fe337071396dbcf2ab0e588..a728b4dc81ca5bbbbcd677ed06687abcfa39334c 100644 (file)
@@ -3116,13 +3116,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                                  true))))
     CmdArgs.push_back("-fms-compatibility");
 
-  // -fmsc-version=1300 is default.
+  // -fmsc-version=1700 is default.
   if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions,
                    getToolChain().getTriple().getOS() == llvm::Triple::Win32) ||
       Args.hasArg(options::OPT_fmsc_version)) {
     StringRef msc_ver = Args.getLastArgValue(options::OPT_fmsc_version);
     if (msc_ver.empty())
-      CmdArgs.push_back("-fmsc-version=1300");
+      CmdArgs.push_back("-fmsc-version=1700");
     else
       CmdArgs.push_back(Args.MakeArgString("-fmsc-version=" + msc_ver));
   }