C++ year_month_day : prevent spaces after '/' date separator

clang-format adds spaces around arithmetic symbols which is good for readability, but how do you prevent spaces when an arithmetic symbol is used in another context.

e.g. C++ year_month_day

using namespace std::chrono;
using namespace std::chrono_literals;

auto ymd = 2022y/January/10;

How to prevent clang-format changing that to:

using namespace std::chrono;
using namespace std::chrono_literals;

auto ymd = 2022y / January / 10;

Hi,
I think that your request is similar to the one in this ticket: Add an option to strip white-spaces around arithmetic operators · Issue #19412 · llvm/llvm-project (github.com).
Short story long, it’s currently not possible to format things like this (neither in all contexts nor in specific ones as here, for chrono literals).
You might want to continue the discussion in the issue report.

Best,


Marek