]> granicus.if.org Git - clang/commitdiff
Don't use operator overload '<' for SourceLocation, it has not semantic meaning.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 23 Jun 2009 00:42:15 +0000 (00:42 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 23 Jun 2009 00:42:15 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73932 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
lib/AST/Decl.cpp

index cfb8f940ab271aa41705736b3dc705f0bba83f40..f594db27bc8f0abc26d2b20c7b175c002055bd8c 100644 (file)
@@ -694,7 +694,6 @@ public:
     return SourceRange(getLocation(), EndRangeLoc);
   }
   void setLocEnd(SourceLocation E) {
-    assert(getLocation() <= E && "Invalid end location");
     EndRangeLoc = E;
   }
   
index 17966269b99367690e1430e231f7423aa715e773..71e88a9efc491d137f0cfba5759bc732ea22d2b3 100644 (file)
@@ -496,7 +496,7 @@ void FunctionDecl::setParams(ASTContext& C, ParmVarDecl **NewParamInfo,
 
     // Update source range. The check below allows us to set EndRangeLoc before
     // setting the parameters.
-    if (EndRangeLoc < NewParamInfo[NumParams-1]->getLocEnd())
+    if (EndRangeLoc.isInvalid() || EndRangeLoc == getLocation())
       EndRangeLoc = NewParamInfo[NumParams-1]->getLocEnd();
   }
 }