diff options
| author | Justin Bogner <mail@justinbogner.com> | 2014-04-16 02:56:48 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2014-04-16 02:56:48 +0000 |
| commit | 4e3a01fa5fab0f31e3b6ab2f8d5130b3fd922932 (patch) | |
| tree | 7761429f14d1c8911a3fe7dabc3434d4b1247b27 /clang/lib | |
| parent | fe1c34266f5da4107b77fcc4f9676d934279f616 (diff) | |
| download | bcm5719-llvm-4e3a01fa5fab0f31e3b6ab2f8d5130b3fd922932.tar.gz bcm5719-llvm-4e3a01fa5fab0f31e3b6ab2f8d5130b3fd922932.zip | |
Lex: Fix __has_feature(cxx_exceptions) for objective C++
At one point, -fexceptions was a synonym for -fcxx-exceptions. While
the driver options still enables cxx-exceptions by default, the cc1
flag is purely about exception tables and this doesn't account for
objective C exceptions. Because of this, checking for the
cxx_exceptions feature in objective C++ often gives the wrong answer.
The cxx_exceptions feature should be based on the -fcxx-exceptions cc1
flag, not -fexceptions. Furthermore, at some point the tests were
changed to use cc1 even though they were testing the driver behaviour.
We're better off testing both the driver and cc1 here.
llvm-svn: 206352
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 76ab940db0a..cd96f8cf34c 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -886,7 +886,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("attribute_unused_on_fields", true) .Case("blocks", LangOpts.Blocks) .Case("c_thread_safety_attributes", true) - .Case("cxx_exceptions", LangOpts.Exceptions) + .Case("cxx_exceptions", LangOpts.CXXExceptions) .Case("cxx_rtti", LangOpts.RTTI) .Case("enumerator_attributes", true) .Case("memory_sanitizer", LangOpts.Sanitize.Memory) |

