diff options
| author | Eric Fiselier <eric@efcs.ca> | 2015-08-18 19:39:35 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2015-08-18 19:39:35 +0000 |
| commit | 556f9340f75ab0300ec194d27e115be8a91d849e (patch) | |
| tree | 8825422962a1ab04ba2f8337361c014f6067d549 /libcxx/include | |
| parent | 519ec4b9be17bcf300ade6abfae237d076ca5809 (diff) | |
| download | bcm5719-llvm-556f9340f75ab0300ec194d27e115be8a91d849e.tar.gz bcm5719-llvm-556f9340f75ab0300ec194d27e115be8a91d849e.zip | |
[libcxx] Disable -Wnon-virtual-dtor warning in <locale>
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 <locale>.
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
llvm-svn: 245333
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/locale | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/include/locale b/libcxx/include/locale index e683ba33ae9..456bd1c6c00 100644 --- a/libcxx/include/locale +++ b/libcxx/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 <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> > |

