public:
explicit BeforeThanCompare(const SourceManager &SM) : SM(SM) { }
- bool operator()(const RawComment &LHS, const SourceRange &RHS) {
+ bool operator()(const RawComment &LHS, const RawComment &RHS) {
return SM.isBeforeInTranslationUnit(LHS.getSourceRange().getBegin(),
- RHS.getBegin());
+ RHS.getSourceRange().getBegin());
}
};
ArrayRef<RawComment>::iterator Comment
= std::lower_bound(RawComments.begin(),
RawComments.end(),
- SourceRange(DeclLoc),
+ RawComment(SourceMgr, SourceRange(DeclLoc)),
BeforeThanCompare<RawComment>(SourceMgr));
// Decompose the location for the declaration and find the beginning of the
Range(SR), RawTextValid(false), IsAlmostTrailingComment(false),
BeginLineValid(false), EndLineValid(false) {
// Extract raw comment text, if possible.
- if (getRawText(SourceMgr).empty()) {
+ if (SR.getBegin() == SR.getEnd() || getRawText(SourceMgr).empty()) {
Kind = CK_Invalid;
return;
}