summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-07-28 00:42:01 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-07-28 00:42:01 +0000
commitc67dd95697b35654614b04d00c8fd7c720ff49b0 (patch)
tree0ad8246377737a8be5c5cd529455a4bed8ae923b /clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp
parent2e46f720fadddbc4ea8ef80ede715e9da1037d3f (diff)
downloadbcm5719-llvm-c67dd95697b35654614b04d00c8fd7c720ff49b0.tar.gz
bcm5719-llvm-c67dd95697b35654614b04d00c8fd7c720ff49b0.zip
clang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls
Ensure that Context is always properly initialised in the constructor. It is used for querying the LangOpts in VisitTypeLoc. Prevent a null pointer dereference in setResult by ensuring that a RecordDecl is being handled. Patch by Alexander Shaposhnikov! llvm-svn: 276948
Diffstat (limited to 'clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp')
-rw-r--r--clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp b/clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp
new file mode 100644
index 00000000000..32681b6714c
--- /dev/null
+++ b/clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-rename -old-name=Foo -new-name=Bar %s -- | FileCheck %s
+
+void foo() {
+}
+
+class Foo { // CHECK: class Bar
+};
+
+int main() {
+ Foo *Pointer = 0; // CHECK: Bar *Pointer = 0;
+ return 0;
+}
+
OpenPOWER on IntegriCloud