Author: Kazu Hirata Date: 2025-11-06T06:51:41-08:00 New Revision: d5d697f3591280448c139b9b5393b0532f674969
URL: https://github.com/llvm/llvm-project/commit/d5d697f3591280448c139b9b5393b0532f674969 DIFF: https://github.com/llvm/llvm-project/commit/d5d697f3591280448c139b9b5393b0532f674969.diff LOG: [clang] Remove redundant declarations (NFC) (#166711) In C++17, static constexpr members are implicitly inline, so they no longer require an out-of-line definition. Identified with readability-redundant-declaration. Added: Modified: clang/lib/Analysis/ExprMutationAnalyzer.cpp clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp Removed: ################################################################################ diff --git a/clang/lib/Analysis/ExprMutationAnalyzer.cpp b/clang/lib/Analysis/ExprMutationAnalyzer.cpp index 54c30c05c3e19..2f40c7e4888e3 100644 --- a/clang/lib/Analysis/ExprMutationAnalyzer.cpp +++ b/clang/lib/Analysis/ExprMutationAnalyzer.cpp @@ -238,10 +238,12 @@ const auto isMoveOnly = [] { }; template <class T> struct NodeID; -template <> struct NodeID<Expr> { static constexpr StringRef value = "expr"; }; -template <> struct NodeID<Decl> { static constexpr StringRef value = "decl"; }; -constexpr StringRef NodeID<Expr>::value; -constexpr StringRef NodeID<Decl>::value; +template <> struct NodeID<Expr> { + static constexpr StringRef value = "expr"; +}; +template <> struct NodeID<Decl> { + static constexpr StringRef value = "decl"; +}; template <class T, class F = const Stmt *(ExprMutationAnalyzer::Analyzer::*)(const T *)> diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 63f0d70238992..0ba3c05d2d163 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -3254,9 +3254,6 @@ bool ConditionBRVisitor::printValue(const Expr *CondVarExpr, raw_ostream &Out, return true; } -constexpr llvm::StringLiteral ConditionBRVisitor::GenericTrueMessage; -constexpr llvm::StringLiteral ConditionBRVisitor::GenericFalseMessage; - bool ConditionBRVisitor::isPieceMessageGeneric( const PathDiagnosticPiece *Piece) { return Piece->getString() == GenericTrueMessage || diff --git a/clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp b/clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp index a06f7e2900d47..3d63d4ab506ab 100644 --- a/clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp +++ b/clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp @@ -10,8 +10,6 @@ namespace clang { namespace syntax { -constexpr llvm::StringLiteral syntax::TokenBufferTokenManager::Kind; - std::pair<FileID, ArrayRef<syntax::Token>> syntax::TokenBufferTokenManager::lexBuffer( std::unique_ptr<llvm::MemoryBuffer> Input) { _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
