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 cfb8f94..f594db2 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -694,7 +694,6 @@
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 1796626..71e88a9 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -496,7 +496,7 @@
// 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();
}
}