1-modify.diff LGTM.<div><br></div><div>These function names seem to be rather unclear: isDeletedAsWritten means "is this declaration explicitly deleted?", setDeletedAsWritten means "set that this declaration is (implicitly or explicitly) deleted". :(<br>
<br><div class="gmail_quote">On Mon, Jul 9, 2012 at 9:51 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ping.<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jul 2, 2012 at 9:35 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
> Ping.<br>
><br>
> On Tue, Jun 26, 2012 at 11:37 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>> The following code is (incorrectly) rejected:<br>
>><br>
>> template<typename> void foo() = delete;<br>
>> template<typename> void foo(); // remove this line & the error is not produced<br>
>> template void foo<int>(); // "explicit instantiation of undefined<br>
>> function template 'foo'"<br>
>><br>
>> There's a few ways to fix this & I'm not sure which one is preferred:<br>
>><br>
>> 1) Correct the first 3 lines of<br>
>> TemplateDeclInstantiator::InitFunctionInstantiation:<br>
>><br>
>>   if (Tmpl->isDeletedAsWritten())<br>
>>     New->setDeletedAsWritten()<br>
>><br>
>> to<br>
>><br>
>>   if (Tmpl->isDeleted())<br>
>>     New->setDeletedAsWritten()<br>
>><br>
>> In this way, the implicit specialization will always correctly reflect<br>
>> the fact that it's deleted and intervening redeclarations won't<br>
>> confuse/break this invariant.<br>
>><br>
>> 2) Remove the first 3 lines of<br>
>> TemplateDeclInstantiator::InitFunctionInstantiator. Since we're only<br>
>> instantiating the declaration, one could argue that it shouldn't be<br>
>> prematurely turned into a definition just because it's deleted<br>
>> (conversely: = delete has to be the first declaration, so having a<br>
>> declaration that isn't an = delete definition is also a bit<br>
>> questionable). In this case we'd need to also fix line<br>
>> SemaTemplateInstantiateDecl:2572 (SemaInstantiateFunctionDefinition)<br>
>> to test "IsDefined()" not just "IsDefaulted()". If that's the way<br>
>> we're going to deal with deleted templates, we could go & change<br>
>> SemaTemplateInstantiateDecl.cpp:1537 for member functions to match<br>
>> this too (hmm, actually removing the setDefaulted/setDeleted calls<br>
>> does cause at least one test to fail, so I'd have to poke around more<br>
>> if I was going to do that)<br>
>><br>
>> Any thoughts/preferences?<br>
</div></div><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>