<div class="gmail_quote">On Mon, Jun 25, 2012 at 7:47 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-family:arial,helvetica,sans-serif"><font><div><div class="h5"><div class="gmail_quote">On Mon, Jun 25, 2012 at 2:09 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:arial,helvetica,sans-serif"><font><div class="gmail_quote"><div>On Sun, Jun 24, 2012 at 2:57 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, LGTM.<br><br><br>Incidentally, for this example:<div><br><br>template<typename ...T> struct S  {};<br>
template<typename T> using U = S<int, char, T>;<br></div>template<typename T> using V = U<U<T>>;<br>
int f(S<int, char, U<const double>>);<br>int k = f(V<double>());<br><br>I get:<br><br><stdin>:4:5: note: candidate function not viable: no known conversion from 'S<[2<br>      * ...], <b>struct S<int, char, double></b>>' to 'S<[2 * ...], <b>U<const<br>



      double></b>>' for 1st argument;<br><br>where I would have preferred:<br><br><stdin>:4:5: note: candidate function not viable: no known conversion from 'S<[2<br>      * ...], S<[2 * ...], <b>double</b>>>' to 'S<[2 * ...], S<[2 * ...], <b>const<br>



      double</b>>>' for 1st argument;<br><br>Any idea what's going on there?<div><div><br><br></div></div></blockquote></div><div>Looking into it.  It looks like Clang has 'struct S<int, char, double>' as a SubstTemplateTypeParmType instead of a TemplateSpecializationType, causing the template diffing to handle it as a type without going deeper. </div>


</div></font></div>
</blockquote></div><br></div></div><div>Fixed.</div></font></div>
</blockquote></div><br><div>> +  static const TemplateSpecializationType * GetTemplateSpecializationType(</div><div><br></div><div>Extra space after *.</div><div><br></div><div><div>> +    if (const SubstTemplateTypeParmType *STTPT =</div>
<div>> +            Ty->getAs<SubstTemplateTypeParmType>())</div><div>> +      Ty = STTPT->getReplacementType();</div><div><br></div><div>Is this necessary? Since you next do this:</div><div><br></div><div>
> +</div><div>> +    const RecordType *RT = Ty->getAs<RecordType>();</div></div><div><br></div><div>... I would expect the STTPT desugaring to be covered by the getAs<RecordType>.</div><div><br></div>
<div>Seems fine otherwise. Thanks!</div>