On Wed, Feb 4, 2015 at 1:02 AM, Abramo Bagnara <[email protected]>
wrote:
>
> Using this source:
>
> template <int> struct C { template <typename U> struct D; };
> template <> template <typename V> struct C<0>::D { };
>
> we get the following AST for the second line
>
> `-ClassTemplateDecl 0x8596370 parent 0x8595cf0 prev 0x8596080
> <line:2:13, col:52> col:48 D
> |-TemplateTypeParmDecl 0x8595c20 <col:23, col:32> col:32 typename V
> `-CXXRecordDecl 0x85962a0 parent 0x8595cf0 prev 0x8595ff0 <col:1,
> col:52> col:48 struct D definition
> `-CXXRecordDecl 0x8596440 <col:35, col:48> col:48 implicit struct D
>
> Reading the dump we can note that the range of outer node
> ClassTemplateDecl (col 13-52) is smaller than the one of inner node
> CXXRecordDecl (col 1-52).
>
> This violates an (IMHO) important invariant where it is expected that
> inner nodes have a range that is a subset or equal to range of outer nodes.
>
> I'd think that the CXXRecordDecl range should begin from col 35 and the
> ClassTemplateDecl range should begin from col 1.
>
> Does this sound reasonable?
Yes.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits