clang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 28 Jul 2016 00:42:01 +0000 (00:42 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 28 Jul 2016 00:42:01 +0000 (00:42 +0000)
commitc67dd95697b35654614b04d00c8fd7c720ff49b0
tree0ad8246377737a8be5c5cd529455a4bed8ae923b
parent2e46f720fadddbc4ea8ef80ede715e9da1037d3f
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
clang-tools-extra/clang-rename/USRFinder.cpp
clang-tools-extra/test/clang-rename/FunctionWithClassFindByName.cpp [new file with mode: 0644]