on overload resolution, when the actual reason for the failure is loss of other qualifiers.
- Clang's notes about unconvertible types in overload resolution failure now covers
the source range of parameter declaration of the candidate function declaration.
+- Added a new diagnostic warning group
+ ``-Wdeprecated-redundant-constexpr-static-def``, under the existing
+ ``-Wdeprecated`` group. This controls warnings about out-of-line definitions
+ of 'static constexpr' data members that are unnecessary from C++17 onwards.
+
+ Bug Fixes in This Version
+ -------------------------
*Example Code*:
// For compatibility with GCC.
def : DiagGroup<"deprecated-copy-dtor", [DeprecatedCopyWithDtor]>;
def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
+def DeprecatedRedundantConstexprStaticDef : DiagGroup<"deprecated-redundant-constexpr-static-def">;
def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
def UnguardedAvailabilityNew : DiagGroup<"unguarded-availability-new">;
def UnguardedAvailability : DiagGroup<"unguarded-availability",
DeprecatedThisCapture,
DeprecatedType,
DeprecatedVolatile,
- DeprecatedWritableStr]>,
+ DeprecatedWritableStr,
+ DeprecatedRedundantConstexprStaticDef,
+ ]>,
DiagCategory<"Deprecations">;
def CXX20Designator : DiagGroup<"c++20-designator">;
def warn_deprecated_redundant_constexpr_static_def : Warning<
"out-of-line definition of constexpr static data member is redundant "
"in C++17 and is deprecated">,
- InGroup<Deprecated>, DefaultIgnore;
+ InGroup<DeprecatedRedundantConstexprStaticDef>, DefaultIgnore;
def warn_decl_shadow :
Warning<"declaration shadows a %select{"
--- /dev/null
+// RUN: %clang_cc1 -std=c++17 -verify %s -Werror -Wdeprecated -Wno-error=deprecated-redundant-constexpr-static-def
+
+namespace {
+ struct A {
+ static constexpr int n = 0;
+ static constexpr int m = 0;
+ };
+ constexpr int A::n; // expected-warning{{out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated}}
+ const int A::m; // expected-warning{{out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated}}
+}