Clang currently warns on definitions downgraded to declarations with a const modifier, but not for a constexpr modifier. This patch updates the warning logic to warn on both inputs, and adds a test to check the additional case as well. See also: https://bugs.chromium.org/p/chromium/issues/detail?id=1284718 Differential Revision: https://reviews.llvm.org/D126664
14 lines
280 B
C++
14 lines
280 B
C++
// RUN: %clang_cc1 -std=c++1z -verify %s -Wdeprecated
|
|
|
|
namespace {
|
|
struct A {
|
|
static constexpr int n = 0;
|
|
};
|
|
const int A::n; // expected-warning {{deprecated}}
|
|
|
|
struct B {
|
|
static constexpr int m = 0;
|
|
};
|
|
constexpr int B::m; // expected-warning {{deprecated}}
|
|
}
|