<div class="gmail_quote">On Tue, May 22, 2012 at 2:36 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@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 class="gmail_quote"><div class="im">On Tue, May 22, 2012 at 10:03 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">

<div class="gmail_quote">Hi Daniel,</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div><div>On Tue, May 22, 2012 at 12:18 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div>I have noticed that the start location of FieldDecls is different in template instantiations and in the primary template (the instantiations loose the location of leading qualifiers). The reason is that the location of qualifiers is currently not tracked in the TypeLocs. However, it makes sense to use the primary template's inner start location making the two FieldDecls have the same code range independent of the TypeLoc implementation.</div>



<div><br></div><div>Please find the corresponding patch attached.</div></blockquote><div><br></div></div></div><div>Can you add a test for this? Also, VarDecls (and the substitution of function types for function declarations) seem to have the same problem. We should fix all of them together.</div>

</div></blockquote><div><br></div></div><div>Not much else there is actually tested. I could add RecursiveASTVisitor-tests for a couple of things, but I think this should be well-designed and will take more effort. I can try to find a diagnostic that triggers on this (start location of FieldDecls in template instantiations), but maybe we can get this in as a small bug-fix.</div>
</div></blockquote><div><br></div><div>I've had a brief look, and didn't see a reasonable way to test this. Committed as r157311.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote">
<div>VarDecls seem to be fine, they actually use getInnerLocStart() at the appropriate place. So, we are actually making the behavior more consistent :-).</div></div></blockquote><div><br></div><div>Right you are, I was looking at the instantiation location for the type, which seems like a reasonable use of getTypeSpecStartLoc. </div>
<div><br></div><div>Thanks!</div></div>