From 61277848b39925350447204e131eefb4b32702a9 Mon Sep 17 00:00:00 2001 From: dzzz2001 Date: Sun, 8 Feb 2026 11:57:26 +0800 Subject: [PATCH] Fix C++17 inline constexpr to support C++11 Replace `inline constexpr` with `static constexpr` in ylmcoef.h to eliminate C++17 dependency, as the project only supports up to C++11. Closes #6956 Co-Authored-By: Claude Opus 4.6 --- source/source_base/ylmcoef.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/source_base/ylmcoef.h b/source/source_base/ylmcoef.h index d709087cbf..72a756ee74 100644 --- a/source/source_base/ylmcoef.h +++ b/source/source_base/ylmcoef.h @@ -12,7 +12,8 @@ constexpr int YLMCOEF_SIZE = 36; // GPU version: must use numeric constants (CUDA doesn't support runtime init for __device__) __device__ static const double ylmcoef[YLMCOEF_SIZE] = { #else -inline constexpr double ylmcoef[YLMCOEF_SIZE] = { +// Use static constexpr for C++11 compatibility (inline variables require C++17) +static constexpr double ylmcoef[YLMCOEF_SIZE] = { #endif 0.28209479177387813964, // 1.0 / sqrt(ModuleBase::FOUR_PI) 0.48860251190291992263, // sqrt (3.0 / ModuleBase::FOUR_PI)