From 807e2f12fab52c6abf3e89c02eec0f585b3b8f22 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 7 Feb 2022 16:47:14 +0100 Subject: [PATCH] Revert "Remove -Wweak-template-vtables" Turns out there's still some code referencing this. No harm in keeping it in a bit longer. > as it was planned for removal in clang 15 and we're now past the branch point > > See https://github.com/llvm/llvm-project/issues/19107 > > Differential revision: https://reviews.llvm.org/D118762 This reverts commit 564f9be11c9cb8d131f48df07538fab7a19b41a7. --- clang/docs/ReleaseNotes.rst | 3 --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 +++ clang/test/SemaCXX/warn-weak-vtables.cpp | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index e96d8dc..8704b4f 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -67,9 +67,6 @@ Modified Compiler Flags Removed Compiler Flags ------------------------- -- -Wweak-template-vtables, which was deprecated in the previous release and no - longer had any effect, has been removed. - New Pragmas in Clang -------------------- diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 7f73b9b..f9bfd34 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1651,6 +1651,9 @@ def warn_weak_vtable : Warning< "%0 has no out-of-line virtual method definitions; its vtable will be " "emitted in every translation unit">, InGroup>, DefaultIgnore; +def warn_weak_template_vtable : Warning< + "this warning is no longer in use and will be removed in the next release">, + InGroup>, DefaultIgnore; def ext_using_undefined_std : ExtWarn< "using directive refers to implicitly-defined namespace 'std'">; diff --git a/clang/test/SemaCXX/warn-weak-vtables.cpp b/clang/test/SemaCXX/warn-weak-vtables.cpp index 9355af5..083209fa 100644 --- a/clang/test/SemaCXX/warn-weak-vtables.cpp +++ b/clang/test/SemaCXX/warn-weak-vtables.cpp @@ -3,6 +3,9 @@ // Check that this warning is disabled on MS ABI targets which don't have key // functions. // RUN: %clang_cc1 %s -fsyntax-only -triple %ms_abi_triple -Werror -Wweak-vtables +// +// -Wweak-template-vtables is deprecated but we still parse it. +// RUN: %clang_cc1 %s -fsyntax-only -Werror -Wweak-template-vtables struct A { // expected-warning {{'A' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}} virtual void f() { } -- 2.7.4