diff options
| author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-12-04 09:51:29 +0000 |
|---|---|---|
| committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-12-04 09:51:29 +0000 |
| commit | f335188925b923dc68243f2b2722e5cc5b259e1b (patch) | |
| tree | 7a90e75d9aee7d137ef0e2d4a5d024e8f884db96 /lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | |
| parent | 9d432e0d1412bfdbea7a0d18295d63c7d30d3952 (diff) | |
| download | bcm5719-llvm-f335188925b923dc68243f2b2722e5cc5b259e1b.tar.gz bcm5719-llvm-f335188925b923dc68243f2b2722e5cc5b259e1b.zip | |
[Expr] Check the language before ignoring Objective C keywords
Summary:
This patch adds the check of the language before ignoring names like `id` or
`Class`, which are reserved in Objective C, but are allowed in C++. It is needed
to make it possible to evaluate expressions in a C++ program containing names
like `id` or `Class`.
Reviewers: jingham, zturner, labath, clayborg
Reviewed By: jingham, clayborg
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D54843
llvm-svn: 348240
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index d98a2b25fbb..1116624aab2 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -771,8 +771,9 @@ bool ClangASTSource::IgnoreName(const ConstString name, static const ConstString id_name("id"); static const ConstString Class_name("Class"); - if (name == id_name || name == Class_name) - return true; + if (m_ast_context->getLangOpts().ObjC) + if (name == id_name || name == Class_name) + return true; StringRef name_string_ref = name.GetStringRef(); |

