[cfe-commits] [Patch] Handle qualifiers for template types in during template type diffing.

Richard Trieu rtrieu at google.com
Wed Aug 22 11:21:26 PDT 2012


On Tue, Aug 21, 2012 at 8:15 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Tue, Aug 21, 2012 at 6:59 PM, Richard Trieu <rtrieu at google.com> wrote:
>
>> Currently, template diffing does not handle cases where the templates
>> have qualifiers.  This can lead to warnings such as:
>>
>> ... 'vector<vector<[...]>>' cannot convert to 'vector<vector<[...]>>' ...
>>
>> when the message means, can't convert from vector<const vector<int>> to
>> vector<vector<int>>.  This patch allows the internal diff tree to store the
>> qualifiers for template types and adds new methods for finding the
>> difference between sets of qualifiers and to print out the qualifiers.
>>  This does not affect non-template types as they already print qualifiers.
>>
>
> It seems inconsistent that we print:
>
> +// CHECK-ELIDE-TREE:       [const int != int]>>
>
> ... for a non-template type but...
>
> +// CHECK-ELIDE-TREE:     [const != (no qualifiers)] vector<
>
> ... for a template type. Can we use the latter form (and qualifier
> highlighting) in both cases?
>

Yes, it should be possible to print qualifiers on all types.

>
> Examples:
>> vector<const vector<int>> and vector<vector<int>>
>> inline: vector<const vector<[...]>> vs. vector<(missing const)
>> vector<[...]>
>> tree:
>> vector<
>>   [const != (no qualifiers)] vector<
>>     [...]>>
>>
>> vector<const vector<int>> and vector<volatile vector<int>>
>> inline: vector<const (missing volatile) vector<[...]>> vs vector<volatile
>> (missing const) vector<[...]>>
>> tree:
>> vector<
>>   [const != volatile] vector<
>>     [...]>>
>>
>> Highlighting is also added for the differing qualifiers.
>>
>> _______________________________________________
>> 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/20120822/945d2a57/attachment.html>


More information about the cfe-commits mailing list