Fix segfault in hasDeclContext for nodes that have no decl context.
authorSamuel Benzaquen <sbenza@google.com>
Mon, 27 Oct 2014 20:58:44 +0000 (20:58 +0000)
committerSamuel Benzaquen <sbenza@google.com>
Mon, 27 Oct 2014 20:58:44 +0000 (20:58 +0000)
commitd93fcc1b289457e50e9738ce854bdde1b69012f7
tree319865a6add4396280a50a5c9b03957ca140b7e8
parente9afaf71f7fb9e2e60519f827a4a7c01d619be37
Fix segfault in hasDeclContext for nodes that have no decl context.

Summary:
Some declarations do not have a declaration context, like TranslationUnitDecl.
Fix hasDeclContext() to not segfault on these nodes.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D6003

llvm-svn: 220719
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/unittests/ASTMatchers/ASTMatchersTest.cpp