<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 17, 2015 at 5:47 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Wed, Dec 16, 2015 at 11:46 PM, Richard Trieu via cfe-commits<br>
<<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
> Author: rtrieu<br>
> Date: Wed Dec 16 22:46:48 2015<br>
> New Revision: 255875<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=255875&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=255875&view=rev</a><br>
> Log:<br>
> Add QualType case to operator< for DynTypedNode.<br>
><br>
> This allows sorting DynTypedNode's which are QualType's since QualType does<br>
> not have memoization.<br>
><br>
> Modified:<br>
>     cfe/trunk/include/clang/AST/ASTTypeTraits.h<br>
><br>
> Modified: cfe/trunk/include/clang/AST/ASTTypeTraits.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTTypeTraits.h?rev=255875&r1=255874&r2=255875&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTTypeTraits.h?rev=255875&r1=255874&r2=255875&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/AST/ASTTypeTraits.h (original)<br>
> +++ cfe/trunk/include/clang/AST/ASTTypeTraits.h Wed Dec 16 22:46:48 2015<br>
> @@ -271,6 +271,10 @@ public:<br>
>      if (!NodeKind.isSame(Other.NodeKind))<br>
>        return NodeKind < Other.NodeKind;<br>
><br>
> +    if (ASTNodeKind::getFromNodeKind<QualType>().isSame(NodeKind))<br>
> +      return getUnchecked<QualType>().getAsOpaquePtr() ==<br>
> +             Other.getUnchecked<QualType>().getAsOpaquePtr();<br>
> +<br>
<br>
</span>This only tests for equality, not comparison, which means operator< no<br>
longer has a strict weak ordering. Also, there are no tests for this<br>
change.<br>
<span class=""><font color="#888888"><br>
~Aaron<br>
</font></span><div class=""><div class="h5"><br></div></div></blockquote><div>r255929 changes the operator to '<', which should fix this.  I don't have a test case since the assertion was triggered in a recently checked in Clang Tidy test that only fails in a special configuration that I couldn't reproduce in a clean change.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
>      if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(NodeKind)) {<br>
>        auto TLA = getUnchecked<TypeLoc>();<br>
>        auto TLB = Other.getUnchecked<TypeLoc>();<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">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>
</div></div></blockquote></div><br></div></div>