Workaround ASTMatcher crashes. Added some more test cases.
authorEric Liu <ioeric@google.com>
Tue, 27 Sep 2016 12:54:48 +0000 (12:54 +0000)
committerEric Liu <ioeric@google.com>
Tue, 27 Sep 2016 12:54:48 +0000 (12:54 +0000)
commit912d0394626f2e7a57c1c353370e9f82240f2d6f
tree8af0317a7f629c3ec4e8d6ba9e950edcd3cde4c9
parent0486d585c59a993e5d2dfffe18b487e1886ac853
Workaround ASTMatcher crashes. Added some more test cases.

Summary:
- UsingDecl matcher crashed when `UsingShadowDecl` has no parent map. Workaround by moving parent check into `UsingDecl`.
- FunctionDecl matcher crashed when there is a lambda defined in parameter list (also due to no parent map).
  Workaround by putting `unless(cxxMethodDecl())` before parent check.

Reviewers: klimek, sbenza, aaron.ballman, hokein

Subscribers: aaron.ballman, cfe-commits

Differential Revision: https://reviews.llvm.org/D24862

llvm-svn: 282486
clang-tools-extra/change-namespace/ChangeNamespace.cpp
clang-tools-extra/unittests/change-namespace/ChangeNamespaceTests.cpp