<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 4, 2015 at 1:02 AM, Abramo Bagnara <span dir="ltr"><<a href="mailto:abramo.bagnara@bugseng.com" target="_blank">abramo.bagnara@bugseng.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Using this source:<br>
<br>
template <int> struct C { template <typename U> struct D; };<br>
template <> template <typename V> struct C<0>::D { };<br>
<br>
we get the following AST for the second line<br>
<br>
`-ClassTemplateDecl 0x8596370 parent 0x8595cf0 prev 0x8596080<br>
<line:2:13, col:52> col:48 D<br>
  |-TemplateTypeParmDecl 0x8595c20 <col:23, col:32> col:32 typename V<br>
  `-CXXRecordDecl 0x85962a0 parent 0x8595cf0 prev 0x8595ff0 <col:1,<br>
col:52> col:48 struct D definition<br>
    `-CXXRecordDecl 0x8596440 <col:35, col:48> col:48 implicit struct D<br>
<br>
Reading the dump we can note that the range of outer node<br>
ClassTemplateDecl (col 13-52) is smaller than the one of inner node<br>
CXXRecordDecl (col 1-52).<br>
<br>
This violates an (IMHO) important invariant where it is expected that<br>
inner nodes have a range that is a subset or equal to range of outer nodes.<br>
<br>
I'd think that the CXXRecordDecl range should begin from col 35 and the<br>
ClassTemplateDecl range should begin from col 1.<br>
<br>
Does this sound reasonable?</blockquote><div><br></div><div>Yes. </div></div></div></div>