diff options
author | Anders Carlsson <andersca@mac.com> | 2009-01-21 18:47:36 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-01-21 18:47:36 +0000 |
commit | e56f6ffb12bfd9081063128d2cda8b77188c8889 (patch) | |
tree | 13661d0321127b0ef2de21768014ef528d25c9dc /Driver/clang.cpp | |
parent | fd52fc7cb1405f05d48f2bef284ca76df00b6649 (diff) |
Don't turn off blocks when compiling Obj-C code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r-- | Driver/clang.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 747f7e164d..1fec6fa3d3 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -595,7 +595,8 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK, // If in a conformant language mode (e.g. -std=c99) Blocks defaults to off // even if they are normally on for the target. In GNU modes (e.g. // -std=gnu99) the default for blocks depends on the target settings. - if (LangStd < lang_gnu_START) + // However, blocks are not turned off when compiling Obj-C or Obj-C++ code. + if (!Options.ObjC1 && LangStd < lang_gnu_START) Options.Blocks = 0; Options.DollarIdents = 1; // FIXME: Really a target property. |