Summary:
RK_Pattern results can also have associated declarations e.g. field
decls in constructor initializers.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49484
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337394
91177308-0d34-0410-b5e6-
96231b3b80d8
computeCursorKindAndAvailability();
}
- /// Retrieve the declaration stored in this result.
+ /// Retrieve the declaration stored in this result. This might be nullptr if
+ /// Kind is RK_Pattern.
const NamedDecl *getDeclaration() const {
- assert(Kind == RK_Declaration && "Not a declaration result");
+ assert(((Kind == RK_Declaration) || (Kind == RK_Pattern)) &&
+ "Not a declaration or pattern result");
return Declaration;
}