fix -ansi in c++: it means -std=c++98
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84254 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 2a9ff8f..e638d87 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -769,7 +769,10 @@
// option.
if (Arg *Std = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi)) {
if (Std->getOption().matches(options::OPT_ansi))
- CmdArgs.push_back("-std=c89");
+ if (types::isCXX(InputType))
+ CmdArgs.push_back("-std=c++98");
+ else
+ CmdArgs.push_back("-std=c89");
else
Std->render(Args, CmdArgs);