aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-10-16 14:28:06 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-10-16 14:28:06 +0000
commit528365d3189d27f3a90a4012baaa8b2814e0a231 (patch)
tree518ed19493443e38c393d1a19b1e02eb0acc2cd2 /lib/Driver/Tools.cpp
parent16a8904f3f5ed19158657e1da95e5902fbee66f7 (diff)
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
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 2a9ff8f676..e638d8771c 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -769,7 +769,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// 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);