mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 08:36:41 +00:00

In https://reviews.llvm.org/D126664, a warning is introduced warning against the deprecated out of line definition of a static constexpr member in C++17 and later. Prior to this patch, the only diagnostic group controlling this diagnostic was -Wdeprecated, which controls many many diagnostics. This patch creates a diagnostic group specifically for this warning so it can be controlled in isolation, while also being included with -Wdeprecated. Differential Revision: https://reviews.llvm.org/D153881
11 lines
488 B
C++
11 lines
488 B
C++
// 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}}
|
|
}
|