diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/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">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1411,7 +1411,8 @@ DefaultIgnore, InGroup; def warn_inline_namespace_reopened_noninline : Warning< - "inline namespace reopened as a non-inline namespace">; + "inline namespace reopened as a non-inline namespace">, + InGroup; def err_inline_namespace_mismatch : Error< "non-inline namespace cannot be reopened as inline">; diff --git a/clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp b/clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp new file mode 100644 --- /dev/null +++ b/clang/test/SemaCXX/warn-inline-namespace-reopened-noninline-disable.cpp @@ -0,0 +1,11 @@ +// 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 { + inline namespace {} + #ifndef SILENCE + namespace {} // expected-warning {{inline namespace reopened as a non-inline namespace}} + #else + namespace {} // expected-no-diagnostics + #endif +}