From 85d45f6c0df9d0e96de0a45f0467f1f325b97db1 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Tue, 18 Aug 2015 19:39:35 +0000 Subject: [PATCH] [libcxx] Disable -Wnon-virtual-dtor warning in Summary: 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 . In the libc++ implementation `time_get' has a private base class, `__time_get_c_storage`, with virtual methods but a non-virtual destructor. `time_get` itself can safely be used as a polymorphic base class because it inherits a virtual destructor from `locale::facet`. To placate the compiler we change `__time_get_c_storage`'s destructor from public to protected, ensuring that it will never be deleted polymorphically. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11670 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245333 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/locale | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/locale b/include/locale index e683ba33a..456bd1c6c 100644 --- a/include/locale +++ b/include/locale @@ -1888,6 +1888,9 @@ protected: virtual const string_type& __r() const; virtual const string_type& __x() const; virtual const string_type& __X() const; + + _LIBCPP_ALWAYS_INLINE + ~__time_get_c_storage() {} }; template >