[PATCH] D81825: [Clang] Add support for -Wno-inline-namespace-reopened-noninline
Elvina Yakubova via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 07:01:03 PDT 2020
Elvina updated this revision to Diff 270739.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81825/new/
https://reviews.llvm.org/D81825
Files:
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/test/Misc/warning-flags.c
clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp
Index: clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp
===================================================================
--- /dev/null
+++ clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -Wall -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -Wall -Wno-inline-namespace-reopened-noninline -DSILENCE -verify -std=c++11 %s
+
+namespace X {
+ #ifndef SILENCE
+ inline namespace {} // expected-note {{previous definition}}
+ namespace {} // expected-warning {{inline namespace reopened as a non-inline namespace}}
+ #else
+ // expected-no-diagnostics
+ inline namespace {}
+ namespace {}
+ #endif
+}
Index: clang/test/Misc/warning-flags.c
===================================================================
--- clang/test/Misc/warning-flags.c
+++ clang/test/Misc/warning-flags.c
@@ -18,7 +18,7 @@
The list of warnings below should NEVER grow. It should gradually shrink to 0.
-CHECK: Warnings without flags (69):
+CHECK: Warnings without flags (68):
CHECK-NEXT: ext_expected_semi_decl_list
CHECK-NEXT: ext_explicit_specialization_storage_class
@@ -58,7 +58,6 @@
CHECK-NEXT: warn_ignoring_ftabstop_value
CHECK-NEXT: warn_implements_nscopying
CHECK-NEXT: warn_incompatible_qualified_id
-CHECK-NEXT: warn_inline_namespace_reopened_noninline
CHECK-NEXT: warn_invalid_asm_cast_lvalue
CHECK-NEXT: warn_maynot_respond
CHECK-NEXT: warn_method_param_redefinition
Index: clang/include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1411,7 +1411,8 @@
DefaultIgnore, InGroup<CXXPre17Compat>;
def warn_inline_namespace_reopened_noninline : Warning<
- "inline namespace reopened as a non-inline namespace">;
+ "inline namespace reopened as a non-inline namespace">,
+ InGroup<InlineNamespaceReopenedNoninline>;
def err_inline_namespace_mismatch : Error<
"non-inline namespace cannot be reopened as inline">;
Index: clang/include/clang/Basic/DiagnosticGroups.td
===================================================================
--- clang/include/clang/Basic/DiagnosticGroups.td
+++ clang/include/clang/Basic/DiagnosticGroups.td
@@ -382,6 +382,8 @@
def PrivateModule : DiagGroup<"private-module">;
def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">;
+def InlineNamespaceReopenedNoninline
+ : DiagGroup<"inline-namespace-reopened-noninline">;
def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81825.270739.patch
Type: text/x-patch
Size: 2770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200615/748bb0ff/attachment.bin>
More information about the llvm-commits
mailing list