Driver: correct behaviour of -fmsc-version=MAJOR

Ensure that we properly handle the case where just the major version component
is provided by the user.

Thanks to Alp Toker for pointing out that this was not handled correctly!

llvm-svn: 211506
This commit is contained in:
Saleem Abdulrasool
2014-06-23 17:36:36 +00:00
parent dd6ab8221e
commit f7062b2313
2 changed files with 11 additions and 1 deletions

View File

@@ -1223,7 +1223,11 @@ static unsigned parseMSCVersion(ArgList &Args, DiagnosticsEngine &Diags) {
<< Arg->getAsString(Args) << Value;
return 0;
}
return (Version < 100000) ? Version * 100000 : Version;
if (Version < 100)
Version = Version * 100; // major -> major.minor
if (Version < 100000)
Version = Version * 100000; // major.minor -> major.minor.build
return Version;
}
// parse the dot-delimited component version