summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-04-29 18:09:03 +0000
committerSean Callanan <scallanan@apple.com>2016-04-29 18:09:03 +0000
commit7736a208b8958a7e708c0756bdce40437f8f48f6 (patch)
tree47114371e62e174ee586383cdc704cdf0cc1a9d4 /lldb/packages/Python/lldbsuite/test
parent327b06400fc208fbd2da720383733d09568ae5f3 (diff)
downloadbcm5719-llvm-7736a208b8958a7e708c0756bdce40437f8f48f6.tar.gz
bcm5719-llvm-7736a208b8958a7e708c0756bdce40437f8f48f6.zip
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile8
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp23
3 files changed, 35 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile
new file mode 100644
index 00000000000..52a92c0b61a
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/Makefile
@@ -0,0 +1,8 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+CXXFLAGS += -std=c++11
+include $(LEVEL)/Makefile.rules
+
+cleanup:
+ rm -f Makefile *.d
+
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py
new file mode 100644
index 00000000000..2249a8c9b16
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals(), [decorators.expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")] )
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp
new file mode 100644
index 00000000000..7614977b245
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/const_this/main.cpp
@@ -0,0 +1,23 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+
+class foo {
+public:
+ template <class T> T func(T x) const {
+ return x+2; //% self.expect("expr 2+3", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["5"])
+ }
+};
+
+int i;
+
+int main() {
+ return foo().func(i);
+}
OpenPOWER on IntegriCloud