================
@@ -18,12 +18,11 @@ namespace clang::tidy::bugprone {
namespace {
AST_MATCHER(clang::VarDecl, hasConstantDeclaration) {
+ if (Node.isConstexpr())
+ return true;
----------------
zeyi2 wrote:
[[dcl.constexpr]](https://eel.is/c++draft/dcl.constexpr): "A constexpr variable
shall be constant-initializable", so I think it is safe to early return it and
would not introduce FPs/FNs. (If a variable is marked `constexpr` but fails to
be constant-initializable, the code is ill-formed and compilation will fail, so
clang will report error.)
https://github.com/llvm/llvm-project/pull/174275
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits