]> granicus.if.org Git - clang/commitdiff
VC9 does not like heterogenous compare function objects.
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 21 Jun 2012 21:02:45 +0000 (21:02 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 21 Jun 2012 21:02:45 +0000 (21:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158936 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RawCommentList.h
lib/AST/ASTContext.cpp
lib/AST/RawCommentList.cpp

index 666a3e6859427898377600e9bf522d702b03bd2a..0f9b18b32b45a37e4d6b88e520454a6e844f20d0 100644 (file)
@@ -129,9 +129,9 @@ class BeforeThanCompare<RawComment> {
 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());
   }
 };
 
index 9f8578bafe3ad3b418c647fe3d070d357bab3cf2..23751a56f24ca22eedf15af2e68538f831216264 100644 (file)
@@ -81,7 +81,7 @@ const RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
   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
index 1baa9b87eb166a728f0ba10e967c57c34bbbeae5..f32e628caa05408bebbe7ed40ea68be6bf5cb576 100644 (file)
@@ -60,7 +60,7 @@ RawComment::RawComment(const SourceManager &SourceMgr, SourceRange SR,
     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;
   }