<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 30, 2015 at 6:43 PM, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">EricWF created this revision.<br>
EricWF added a reviewer: mclow.lists.<br>
EricWF added a subscriber: cfe-commits.<br>
<br>
Normally people won't see warnings in libc++ headers, but if they compile with "-Wsystem-headers -Wnon-virtual-dtor" they will likely see issues in <locale>.<br>
<br>
The struct `time_get` is specified as having a non-virtual protected destructor but in the libc++ implementation `time_get` also has a non-virtual base class with virtual methods.</blockquote><div><br></div><div>If the base class has a protected non-virtual dtor and the derived class is marked final, this warning will not fire (because that interface will ensure no polymorphic destruction occurs). Would that be sufficient for your needs?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I don't believe this is a bug but instead a false positive.<br>
<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11670&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=ItoDbjU2lyDkSxu5d7p_eHlghWwC0mr7niKn_HeaCUU&s=yuvIYfdSR3_c5vT9QXyAMJuQNhbENA7-dFGL7nvdzBA&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11670</a><br>
<br>
Files:<br>
  include/__config<br>
  include/locale<br>
<br>
Index: include/locale<br>
===================================================================<br>
--- include/locale<br>
+++ include/locale<br>
@@ -1875,6 +1875,11 @@<br>
     enum dateorder {no_order, dmy, mdy, ymd, ydm};<br>
 };<br>
<br>
+#if __has_warning("-Wnon-virtual-dtor")<br>
+#pragma clang diagnostic push<br>
+#pragma clang diagnostic ignored "-Wnon-virtual-dtor"<br>
+#endif<br>
+<br>
 template <class _CharT><br>
 class _LIBCPP_TYPE_VIS_ONLY __time_get_c_storage<br>
 {<br>
@@ -1890,6 +1895,10 @@<br>
     virtual const string_type& __X() const;<br>
 };<br>
<br>
+#if __has_warning("-Wnon-virtual-dtor")<br>
+#pragma clang diagnostic pop<br>
+#endif<br>
+<br>
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> ><br>
 class _LIBCPP_TYPE_VIS_ONLY time_get<br>
     : public locale::facet,<br>
Index: include/__config<br>
===================================================================<br>
--- include/__config<br>
+++ include/__config<br>
@@ -45,6 +45,9 @@<br>
 #ifndef __is_identifier<br>
 #define __is_identifier(__x) 1<br>
 #endif<br>
+#ifndef __has_warning<br>
+#define __has_warning(__x) 0<br>
+#endif<br>
<br>
<br>
 #ifdef __LITTLE_ENDIAN__<br>
<br>
<br>
<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" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>