[libcxx-commits] [PATCH] D127900: [libc++] Enable -Wweak-vtables

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 15 12:56:11 PDT 2022


philnik created this revision.
philnik added a reviewer: ldionne.
Herald added a subscriber: arichardson.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This makes Clang scream at us if there is a class without a key function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127900

Files:
  libcxx/include/__functional/function.h
  libcxx/utils/libcxx/test/params.py


Index: libcxx/utils/libcxx/test/params.py
===================================================================
--- libcxx/utils/libcxx/test/params.py
+++ libcxx/utils/libcxx/test/params.py
@@ -16,6 +16,7 @@
   '-Wextra',
   '-Wshadow',
   '-Wundef',
+  '-Wweak-vtables',
   '-Wno-unused-command-line-argument',
   '-Wno-attributes',
   '-Wno-pessimizing-move',
Index: libcxx/include/__functional/function.h
===================================================================
--- libcxx/include/__functional/function.h
+++ libcxx/include/__functional/function.h
@@ -35,6 +35,8 @@
 
 // bad_function_call
 
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
 class _LIBCPP_EXCEPTION_ABI bad_function_call
     : public exception
 {
@@ -52,6 +54,7 @@
     virtual const char* what() const _NOEXCEPT;
 #endif
 };
+_LIBCPP_DIAGNOSTIC_POP
 
 _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
 void __throw_bad_function_call()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127900.437305.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220615/e584e70d/attachment.bin>


More information about the libcxx-commits mailing list