diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2013-11-02 23:19:53 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2013-11-02 23:19:53 +0000 |
| commit | 0f7445b6155e9174d80d82ba00ef8e67f001449b (patch) | |
| tree | 96e3ea255bba0e83f022c7c9364b6a36e0609370 | |
| parent | 586af97a303873d62505a0734f1306d37523c532 (diff) | |
| download | bcm5719-llvm-0f7445b6155e9174d80d82ba00ef8e67f001449b.tar.gz bcm5719-llvm-0f7445b6155e9174d80d82ba00ef8e67f001449b.zip | |
Default to use libc++ on OS X 10.9+ and iOS 7+.
llvm-svn: 193934
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 6 | ||||
| -rw-r--r-- | clang/test/PCH/cxx-typeid.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 99a182e4013..cc1efb69c9e 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -839,6 +839,12 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, } } + // Default to use libc++ on OS X 10.9+ and iOS 7+. + if (((isTargetMacOS() && !isMacosxVersionLT(10, 9)) || + (isTargetIPhoneOS() && !isIPhoneOSVersionLT(7, 0))) && + !Args.getLastArg(options::OPT_stdlib_EQ)) + DAL->AddJoinedArg(0, Opts.getOption(options::OPT_stdlib_EQ), "libc++"); + // Validate the C++ standard library choice. CXXStdlibType Type = GetCXXStdlibType(*DAL); if (Type == ToolChain::CST_Libcxx) { diff --git a/clang/test/PCH/cxx-typeid.cpp b/clang/test/PCH/cxx-typeid.cpp index 534863af21b..6e622206521 100644 --- a/clang/test/PCH/cxx-typeid.cpp +++ b/clang/test/PCH/cxx-typeid.cpp @@ -1,8 +1,8 @@ // Test this without pch. -// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s +// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -stdlib=libstdc++ -verify %s -// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h -// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s +// RUN: %clang_cc1 -x c++-header -emit-pch -stdlib=libstdc++ -o %t.pch %S/cxx-typeid.h +// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -stdlib=libstdc++ -verify %s // expected-no-diagnostics |

