<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Courier New;color: #000000;font-size: 10pt;">
The test-case compiles fine with & without the base struct: <a href="https://goo.gl/gChBXX" target="_blank">
https://goo.gl/gChBXX</a><br>
<br>
-Vasileios<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF496646"><font color="#000000" face="Tahoma" size="2"><b>From:</b> David Blaikie [dblaikie@gmail.com]<br>
<b>Sent:</b> 12 November 2015 16:21<br>
<b>To:</b> Vasileios Kalintiris<br>
<b>Cc:</b> llvm-commits@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm] r252537 - Fix -Wdeprecated warnings due to the use of copy ops on SCEVPredicate derived class objects<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 12, 2015 at 7:06 AM, Vasileios Kalintiris <span dir="ltr">
<<a href="mailto:Vasileios.Kalintiris@imgtec.com" target="_blank">Vasileios.Kalintiris@imgtec.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi David,<br>
<br>
This introduced a "class has virtual functions and accessible non-virtual destructor" warning that is being printed a lot of times (g++ 5.2.1). Can you look at this?<br>
</blockquote>
<div><br>
</div>
<div>We should disable that warning on GCC. This API seems safe to me, no? The base class's dtor is protected (so external users can't polymorphically delete objects) and the derived classes have public non-virtual dtors, but are final (so no further classes
 can derived from them)<br>
<br>
This is not the only API that uses that pattern - oh, maybe it's the FoldingSetNode that's complicating this? Could you check if this produces the warning on GCC (is there a pastebin that runs that version of GCC so I can check this myself easily?)<br>
<br>
struct base {<br>
};<br>
<br>
struct middle: base {<br>
  virtual void func();<br>
protected:</div>
<div>  ~middle() = default;<br>
};</div>
<div><br>
</div>
<div>struct derived final : middle {<br>
};<br>
<br>
& then if you remove the base class, does the warning go away?<br>
<br>
- Dave</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<br>
Thanks,<br>
Vasileios<br>
<br>
[8/101] /usr/local/bin/g++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Transforms/Utils -I/home/vk/repos/llvm/lib/Transforms/Utils -Iinclude -I/home/vk/r<br>
epos/llvm/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -Wno-comment -std<br>
=c++11 -g -fPIC   -gsplit-dwarf  -fno-exceptions -fno-rtti -MMD -MT lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyIndVar.cpp.o -MF lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyIndVar.cpp.o.d -o<br>
lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyIndVar.cpp.o -c /home/vk/repos/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp<br>
In file included from /home/vk/repos/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:19:0,<br>
                 from /home/vk/repos/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp:22:<br>
/home/vk/repos/llvm/include/llvm/Analysis/ScalarEvolution.h:174:9: warning: ‘class llvm::SCEVPredicate’ has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]<br>
   class SCEVPredicate : public FoldingSetNode {<br>
         ^<br>
/home/vk/repos/llvm/include/llvm/Analysis/ScalarEvolution.h:244:9: warning: base class ‘class llvm::SCEVPredicate’ has accessible non-virtual destructor [-Wnon-virtual-dtor]<br>
<span class="">   class SCEVEqualPredicate final : public SCEVPredicate {<br>
</span>         ^<br>
/home/vk/repos/llvm/include/llvm/Analysis/ScalarEvolution.h:275:9: warning: base class ‘class llvm::SCEVPredicate’ has accessible non-virtual destructor [-Wnon-virtual-dtor]<br>
<span class="">   class SCEVUnionPredicate final : public SCEVPredicate {<br>
</span>         ^</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>