<div dir="ltr">test case?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 30, 2018 at 1:39 PM Stephen Kelly via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: steveire<br>
Date: Mon Jul 30 13:39:14 2018<br>
New Revision: 338301<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=338301&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=338301&view=rev</a><br>
Log:<br>
Avoid returning an invalid end source loc<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/DeclarationName.h<br>
    cfe/trunk/lib/AST/DeclarationName.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/DeclarationName.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=338301&r1=338300&r2=338301&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=338301&r1=338300&r2=338301&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)<br>
+++ cfe/trunk/include/clang/AST/DeclarationName.h Mon Jul 30 13:39:14 2018<br>
@@ -558,7 +558,7 @@ public:<br>
   SourceLocation getBeginLoc() const { return NameLoc; }<br>
<br>
   /// getEndLoc - Retrieve the location of the last token.<br>
-  SourceLocation getEndLoc() const;<br>
+  SourceLocation getEndLoc() const { return getLocEnd(); }<br>
<br>
   /// getSourceRange - The range of the declaration name.<br>
   SourceRange getSourceRange() const LLVM_READONLY {<br>
@@ -570,9 +570,11 @@ public:<br>
   }<br>
<br>
   SourceLocation getLocEnd() const LLVM_READONLY {<br>
-    SourceLocation EndLoc = getEndLoc();<br>
+    SourceLocation EndLoc = getEndLocPrivate();<br>
     return EndLoc.isValid() ? EndLoc : getLocStart();<br>
   }<br>
+private:<br>
+  SourceLocation getEndLocPrivate() const;<br>
 };<br>
<br>
 /// Insertion operator for diagnostics.  This allows sending DeclarationName's<br>
<br>
Modified: cfe/trunk/lib/AST/DeclarationName.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=338301&r1=338300&r2=338301&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=338301&r1=338300&r2=338301&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclarationName.cpp Mon Jul 30 13:39:14 2018<br>
@@ -689,7 +689,7 @@ void DeclarationNameInfo::printName(raw_<br>
   llvm_unreachable("Unexpected declaration name kind");<br>
 }<br>
<br>
-SourceLocation DeclarationNameInfo::getEndLoc() const {<br>
+SourceLocation DeclarationNameInfo::getEndLocPrivate() const {<br>
   switch (Name.getNameKind()) {<br>
   case DeclarationName::Identifier:<br>
   case DeclarationName::CXXDeductionGuideName:<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>