From: Argyrios Kyrtzidis Date: Tue, 23 Jun 2009 00:42:15 +0000 (+0000) Subject: Don't use operator overload '<' for SourceLocation, it has not semantic meaning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb5f8f59322c352f51714c3de5d8047e70895165;p=clang Don't use operator overload '<' for SourceLocation, it has not semantic meaning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73932 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index cfb8f940ab..f594db27bc 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -694,7 +694,6 @@ public: return SourceRange(getLocation(), EndRangeLoc); } void setLocEnd(SourceLocation E) { - assert(getLocation() <= E && "Invalid end location"); EndRangeLoc = E; } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 17966269b9..71e88a9efc 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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(); } }