From f7062b23137f3fda28c6edbfbe1b3668af00b0c2 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 23 Jun 2014 17:36:36 +0000 Subject: 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 --- clang/lib/Frontend/CompilerInvocation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9174e4f..7113886 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -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 -- cgit v1.1