Righto, thanks for clarifying. Two questions spring to mind:<div><br></div><div>1. I assume the same is true for the whole if-else block in <span style="font-family:arial,sans-serif;font-size:13px">CheckMemberSpecialization() </span>that applies TSK_ExplicitSpecialization for various Decl types?</div>
<div><br></div><div>2. Where should any tests for this change live?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 January 2013 22:07, 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="HOEnZb"><div class="h5">On Tue, Jan 8, 2013 at 6:22 AM, Will Wilson <<a href="mailto:will@indefiant.com">will@indefiant.com</a>> wrote:<br>

> Hi All,<br>
><br>
> I've run into what looks like a bug (or possibly ambiguous behaviour) when<br>
> examining specialized static members of a templated class.<br>
><br>
> template <typename T><br>
> class TemplatedClass<br>
> {<br>
> public:<br>
> static int Foo;<br>
> };<br>
><br>
> template <typename T><br>
> int TemplatedClass<T>::Foo = 1;<br>
><br>
> template <><br>
> int TemplatedClass<int>::Foo = 2;<br>
><br>
> The <int> specialization generates two VarDecls (as expected), one for the<br>
> declaration and one for the definition. However if you query<br>
> getSourceRange() for the declaration it will give you a range extending from<br>
> the declaration to the definition - rather than one simply covering the<br>
> declaration. This proves problematic when it comes to rewriting such<br>
> declarations.<br>
><br>
> The declaration's location is set to the definition location by<br>
> Sema::CheckMemberSpecialization(). In some ways this is correct as the<br>
> specialization obviously "spawns" the specialized declaration but it does<br>
> make the SourceRange somewhat useless in this case.<br>
><br>
> Any thoughts on this? It's easily resolved by removing the setLocation()<br>
> call in CheckMemberSpecialization() but my feeling is this may be incorrect<br>
> (or at least losing information). It's almost like there should be a<br>
> "SourceLocation PointOfSpecialization" member in MemberSpecializationInfo -<br>
> but perhaps I'm completely on the wrong track?<br>
<br>
</div></div>This is a bug. We shouldn't be updating the location of the<br>
declaration when we see the explicit specialization. Patches welcome<br>
:-)<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="background-color:rgb(255,255,255);color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif"><b>Indefiant Ltd.</b></span></div><div><font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px"><b><br>
</b></span></font></div><font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px">Firsby Lodge, New Main Road, Scamblesby, Louth, Lincs LN11 9XH UK<br></span></font><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;background-color:rgb(255,255,255)">
<span style="color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif;font-size:x-small"><i>Tel: +44 20 8123 7663 England Registered No. 07936820 VAT No. </i></span><span style="background-color:transparent"><font color="#444444" face="Arial, Helvetica, sans-serif" size="1"><i>128556202</i></font></span></div>

</div>