]> granicus.if.org Git - clang/commit
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)
commit03ee47bd153732c48ece2970e27d8740fc443e1e
treeff901d58d28fc5b2ec72f7e0d54357c6c970b2fe
parent16446f30e738aebd31a9d3b1ff81661a395c1553
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220719 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/ASTMatchers/ASTMatchers.h
unittests/ASTMatchers/ASTMatchersTest.cpp