Files
clang-p2996/clang/test/CXX/basic/basic.def/p2.cpp
Luke Nihlen 1f6ea2a37c Expand definition deprecation warning to include constexpr statements.
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
2022-06-01 11:31:07 -04:00

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}}
}