[fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.
authorSean Callanan <scallanan@apple.com>
Fri, 29 Apr 2016 18:09:03 +0000 (18:09 +0000)
committerSean Callanan <scallanan@apple.com>
Fri, 29 Apr 2016 18:09:03 +0000 (18:09 +0000)
commit7736a208b8958a7e708c0756bdce40437f8f48f6
tree47114371e62e174ee586383cdc704cdf0cc1a9d4
parent327b06400fc208fbd2da720383733d09568ae5f3
[fix] Fixed a bug where const this would cause parser errors about $__lldb_expr.

In templated const functions, trying to run an expression would produce the
error

error: out-of-line definition of '$__lldb_expr' does not match any declaration
in 'foo' member declaration does not match because it is const qualified
error: 1 error parsing expression

which is no good.  It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."

Also added a test case.

<rdar://problem/24985958>

llvm-svn: 268083
lldb/include/lldb/Expression/ExpressionSourceCode.h
lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp [new file with mode: 0644]
lldb/source/Expression/ExpressionSourceCode.cpp
lldb/source/Expression/LLVMUserExpression.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp