Skip to content

Commit d073583

Browse files
committed
Update .clang-tidy
1 parent 50f33a6 commit d073583

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.clang-tidy

+9-8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Checks: [
2727
'-bugprone-not-null-terminated-result',
2828
'-bugprone-reserved-identifier', # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
2929
'-bugprone-unchecked-optional-access',
30+
'-bugprone-crtp-constructor-accessibility',
31+
'-bugprone-suspicious-stringview-data-usage',
3032

3133
'-cert-dcl16-c',
3234
'-cert-dcl37-c',
@@ -36,6 +38,7 @@ Checks: [
3638
'-cert-msc51-cpp',
3739
'-cert-oop54-cpp',
3840
'-cert-oop57-cpp',
41+
'-cert-err33-c', # Misreports on clang-19: it warns about all functions containing 'remove' in the name, not only about the standard library.
3942

4043
'-clang-analyzer-optin.performance.Padding',
4144

@@ -94,10 +97,12 @@ Checks: [
9497
'-modernize-pass-by-value',
9598
'-modernize-return-braced-init-list',
9699
'-modernize-use-auto',
100+
'-modernize-use-constraints', # This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
97101
'-modernize-use-default-member-init',
98102
'-modernize-use-emplace',
99103
'-modernize-use-nodiscard',
100104
'-modernize-use-trailing-return-type',
105+
'-modernize-use-designated-initializers',
101106

102107
'-performance-enum-size',
103108
'-performance-inefficient-string-concatenation',
@@ -121,7 +126,8 @@ Checks: [
121126
'-readability-magic-numbers',
122127
'-readability-named-parameter',
123128
'-readability-redundant-declaration',
124-
'-readability-redundant-inline-specifier',
129+
'-readability-redundant-inline-specifier', # useful but incompatible with __attribute((always_inline))__ (aka. ALWAYS_INLINE, base/base/defines.h).
130+
# ALWAYS_INLINE only has an effect if combined with `inline`: https://godbolt.org/z/Eefd74qdM
125131
'-readability-redundant-member-init', # Useful but triggers another problem. Imagine a struct S with multiple String members. Structs are often instantiated via designated
126132
# initializer S s{.s1 = [...], .s2 = [...], [...]}. In this case, compiler warning `missing-field-initializers` requires to specify all members which are not in-struct
127133
# initialized (example: s1 in struct S { String s1; String s2{};}; is not in-struct initialized, therefore it must be specified at instantiation time). As explicitly
@@ -132,12 +138,7 @@ Checks: [
132138
'-readability-uppercase-literal-suffix',
133139
'-readability-use-anyofallof',
134140

135-
'-zircon-*',
136-
137-
# This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
138-
'-modernize-use-constraints',
139-
# https://github.com/abseil/abseil-cpp/issues/1667
140-
'-clang-analyzer-optin.core.EnumCastOutOfRange'
141+
'-zircon-*'
141142
]
142143

143144
WarningsAsErrors: '*'
@@ -172,4 +173,4 @@ CheckOptions:
172173
performance-move-const-arg.CheckTriviallyCopyableMove: false
173174
# Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097
174175
readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type
175-
cppcoreguidelines-avoid-do-while.IgnoreMacros: true
176+
cppcoreguidelines-avoid-do-while.IgnoreMacros: true

0 commit comments

Comments
 (0)