<div dir="ltr">I think the warning is valuable. I do not believe it applies to general class templates that have external linkage.<div><br></div><div>I believe in this case the error is specifically due to the fact the templated function in question has internal linkage. By defining it  inside an anonymous namespace the templated function cannot be used anywhere else, and yet it is unused. So the compiler warns us.</div><div><br></div><div>Potential fixes could be to </div><div><br></div><div>- pull that struct (CheckShallowCopy) out of the anonymous namespace (I think that changes its linkage to external)</div><div><br></div><div>- do an ifdef to remove the function for this test case</div><div><br></div><div>- declare that function in CheckShallowCopy as extern forcing it to have external linkage</div><div><br></div><div>I'm not 100% sure which if any of those solutions would work but that would be my guess. Maybe Sean could give one of them a shot on his system?</div><div><br></div><div><br></div><div>Dave here is the llvm thread I looked at last time that talks a bit about this</div><div><br></div><div><a href="https://reviews.llvm.org/D29877">https://reviews.llvm.org/D29877</a><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 16, 2017 at 8:37 PM, David Cole via vtk-developers <span dir="ltr"><<a href="mailto:vtk-developers@vtk.org" target="_blank">vtk-developers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In this thread :<br>
<a href="http://public.kitware.com/pipermail/vtk-developers/2017-August/035314.html" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>pipermail/vtk-developers/2017-<wbr>August/035314.html</a><br>
, Ken Martin said<br>
<br>
"the llvm folks added this due to some ODR violation checking.<br>
That having it unused can cause it to be defined multiple times in a<br>
translation unit for some reason."<br>
<br>
Despite my Google skillz, I could not find what exactly he was<br>
referring to, and a search on the quoted "-Wunused-template" doesn't<br>
help much. Or I didn't dig deep enough.<br>
<br>
Anyhow:<br>
<br>
I think you should favor limiting the disabled bit of the warning to<br>
the scope where you know it's safe to ignore, and not just put a<br>
blanket suppression on it. Each warning is useful to somebody for some<br>
code, and ignoring them everywhere by a global compile flag is not the<br>
best way to suppress a warning in a handful of files among thousands.<br>
<br>
<br>
Just my opinion ... but there you have it.<br>
<br>
David C.<br>
<br>
<br>
<br>
<br>
<br>
On Wed, Aug 16, 2017 at 7:06 PM, Sean McBride <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>> wrote:<br>
> On Wed, 16 Aug 2017 13:54:26 -0400, Allie Vacanti said:<br>
><br>
>>> Allison, do you think you can work on the data array warnings?<br>
>>><br>
>>> I think if both Allison and I take care of those it should whittle down the<br>
>>> list to a more manageable size to start getting others to help out with.<br>
>><br>
>>I think we should just disable the unused-template warnings. Most of<br>
>>these cases depend on the ArrayDispatch configuration and can't be<br>
>>removed without breaking features, even though some builds don't use<br>
>>them.<br>
><br>
> Allie,<br>
><br>
> OK, so we just have to decide if we should:<br>
>  a) use "#pragma clang diagnostic ignored" to disable this warning for the ArrayDispatch file(s)<br>
> or<br>
>  b) I just add -Wno-unused-template to disable it everywhere and always<br>
><br>
> I guess it depends if the warning is generally useful (except for the funky case of ArrayDispatch stuff), or generally useless.<br>
><br>
> Cheers,<br>
><br>
> --<br>
> ______________________________<wbr>______________________________<br>
> Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
> Rogue Research                        <a href="http://www.rogue-research.com" rel="noreferrer" target="_blank">www.rogue-research.com</a><br>
> Mac Software Developer              Montréal, Québec, Canada<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div></div></div>
</div>