[cfe-commits] [Patch] Add highlighting and type eliding when two templates are used in a diagnostics. Also, template tree printing.

Richard Smith richard at metafoo.co.uk
Sun Jun 24 14:57:03 PDT 2012


Thanks, LGTM.


Incidentally, for this example:

template<typename ...T> struct S  {};
template<typename T> using U = S<int, char, T>;
template<typename T> using V = U<U<T>>;
int f(S<int, char, U<const double>>);
int k = f(V<double>());

I get:

<stdin>:4:5: note: candidate function not viable: no known conversion from
'S<[2
     * ...], *struct S<int, char, double>*>' to 'S<[2 * ...], *U<const
     double>*>' for 1st argument;

where I would have preferred:

<stdin>:4:5: note: candidate function not viable: no known conversion from
'S<[2
     * ...], S<[2 * ...], *double*>>' to 'S<[2 * ...], S<[2 * ...], *const
     double*>>' for 1st argument;

Any idea what's going on there?

On Fri, Jun 22, 2012 at 7:16 PM, Richard Trieu <rtrieu at google.com> wrote:
> On Fri, Jun 22, 2012 at 5:43 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
>>
>> On Fri, Jun 22, 2012 at 4:59 PM, Richard Trieu <rtrieu at google.com> wrote:
>> > Updated template diffing patch.
>>
>> Updated patch looks good to me, but I found a crash on this code while
>> playing with it:
>>
>> template<typename ...T> struct S  {};
>> template<typename T> using U = S<int, char, T>;
>> int f(S<int, char, double>);
>> int k = f(U<char>());
>
>
> Fixed it.  Also added your example to the tests.
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120624/e07c6a37/attachment.html>


More information about the cfe-commits mailing list