nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.36k stars 6.67k forks source link

(clang-tidy): Disable 'modernize-use-designated-initializers' #4333

Closed fsandhei closed 5 months ago

fsandhei commented 5 months ago

modernize-use-designated-initializers checks for initializer lists that could be written as designated initializers instead. See https://clang.llvm.org/extra//clang-tidy/checks/modernize/use-designated-initializers.html

However, this is a C++20 feature. While it can be supported by compilers before C++20, it is still enabled by default by clang-tidy.

Since designated initializers are not in the standard pre C++20, and this library supports versions up to including C++20, I would suggest disabling this check.


Pull request checklist

Read the Contribution Guidelines for detailed information.

Please don't

coveralls commented 5 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling f4cbd47aa01417bd04736814105272df77c26e07 on fsandhei:disable-designated-initializers-check-clang-tidy into 199dea11b17c533721b26249e2dcaee6ca1d51d3 on nlohmann:develop.

fsandhei commented 5 months ago

I see that apparently you have made a similar pull request for this, so I'll close :)