srctree

Robin Linden parent 6cf27bb9 63358146
meta: Re-enable clang-tidy's performance-move-const-arg check

Disabling only the trivially-copyable-move part of the check makes ituseful without being annoying to deal with.

This commit also fixes an attempt to move from a const std::string foundby the check.

inlinesplit
.clang-tidy added: 7, removed: 8, total 0
@@ -33,10 +33,6 @@
#
# -modernize-use-trailing-return-type: Stylistic change, and something we
# haven't been doing so far.
#
# -performance-move-const-arg: Having to know which types are trivially copyable
# seems like unnecessary effort when calling std::move on them isn't really
# harmful.
Checks: >
bugprone-*,
cert-*,
@@ -63,7 +59,6 @@ Checks: >
-modernize-use-emplace,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-move-const-arg,
 
# Workaround for https://github.com/llvm/llvm-project/issues/56709 making it
# impossible to disable the clang-diagnostic-builtin-macro-redefined warning in
@@ -73,6 +68,10 @@ WarningsAsErrors: "*,-clang-diagnostic-builtin-macro-redefined"
HeaderFilterRegex: "\\./(archive|browser|css|css2|dom|dom2|engine|etest|geom|gfx|html|html2|idna|img|js|layout|net|os|protocol|render|style|tui|uri|url|util|wasm)/"
 
CheckOptions:
# performance-move-const-arg
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
 
# readability-identifier-naming
# Classes, structs, ...
- key: readability-identifier-naming.NamespaceCase
 
engine/engine_test.cpp added: 7, removed: 8, total 0
@@ -229,7 +229,7 @@ int main() {
std::string zlibbed_css =
"\x78\x5e\x2b\x50\xa8\x56\x48\xcb\xcf\x2b\xd1\x2d\xce\xac\x4a\xb5\x52\x30\x34\x32\x4e\xcd\xb5\x56\xa8\xe5\x02\x00\x63\xc3\x07\x6f"s;
 
etest::test("stylesheet link, gzip Content-Encoding", [gzipped_css] {
etest::test("stylesheet link, gzip Content-Encoding", [gzipped_css]() mutable {
std::map<std::string, Response> responses;
responses["hax://example.com"s] = Response{
.err = Error::Ok,