{"slug": "clang-tidy", "name": "clang-tidy", "category": "other", "category_name": "Other software", "description": "", "recommenders": 5, "commenters": 9, "warners": 1, "score": 4.162, "rising": -1.64, "first": "2025-11-06", "latest": "2026-10-16", "why": "If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong.", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 5, "neutral": 3, "compare": 0, "warn": 1}, "spark": [2, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong.", "kind": "", "icon": true, "domain": "llvm.org", "github_repo": null, "official_url": "https://clang.llvm.org/extra/clang-tidy/", "pricing": "", "aliases": ["clang-tidy", "Clang-Tidy"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 780351536, "item_id": 48771971, "url": "https://news.ycombinator.com/item?id=48771971", "by": "roflcopter69", "date": "2026-07-03", "stance": "recommend", "quote": "figure out good clang-tidy and clang-format rules", "excerpt": "A serious competitor wouldn't use Rust because it immediately disqualifies your engine from being shipped to consoles. At least at the moment. I know it's less of a technical limitation and more of a political one, but if you are serious about shipping your game to various platforms, you cannot use Rust. But things might be about to change, see https://akaganite.com But honestly, as of today, you're probably having a", "context": "", "use_case": "C++ linting", "switched_from": "", "story": "Godot will no longer accept AI-authored code contributions"}, {"id": 745506881, "item_id": 46594180, "url": "https://news.ycombinator.com/item?id=46594180", "by": "hoyhoy", "date": "2026-01-12", "stance": "recommend", "quote": "If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong.", "excerpt": "I asked the guy working on compiler-rt to change one boolean so the LLVM 18 build would work on macOS, and he locked the whole issue down as \"heated\" and it's still not fixed four years later. I love LLVM though. clang-tidy, ASAN, UBSAN, LSAN, MSAN, and TSAN are AMAZING. If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong. My biggest problem with LLVM rn is that -fbounds-safety is only availa", "context": "C/C++ developer", "use_case": "C/C++ static analysis", "switched_from": "", "story": "LLVM: The Bad Parts"}, {"id": 733754208, "item_id": 45859638, "url": "https://news.ycombinator.com/item?id=45859638", "by": "krona", "date": "2025-11-08", "stance": "recommend", "quote": "clang-tidy has a check for this", "excerpt": "clang-tidy has a check for this. https://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html MSVC and the Clang static analyzer have a analysis checks for this too. Not sure about GCC. It's worth remembering though that values can be reinitialized in C++, after move.", "context": "", "use_case": "", "switched_from": "", "story": "C++ move semantics from scratch (2022)"}, {"id": 733475072, "item_id": 45842192, "url": "https://news.ycombinator.com/item?id=45842192", "by": "actionfromafar", "date": "2025-11-06", "stance": "recommend", "quote": "foremost clang-tidy", "excerpt": "If you are working with C++ in this day and age, regardless of which compiler you use to output your actual binaries, you really owe it to yourself to compile as many source files as possible with other diagnostic tools, foremost clang-tidy. It will catch that and a lot of iffy stuff. If you want to go deeper, you can also add your own diagnostics, which can have knowledge specific to your program. https://clang.llvm", "context": "", "use_case": "C++ static analysis", "switched_from": "", "story": "A prvalue is not a temporary"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 754598720, "item_id": 47162420, "url": "https://news.ycombinator.com/item?id=47162420", "by": "rurban", "date": "2026-02-25", "stance": "warn", "quote": "python and clang-tidy were very unsuccessful with this approach", "excerpt": "That's a user pipeline problem. If you just check confusables without any tr39 algo you will be disappointed also. I had to patch confusables for the C/C++ proposal for about 10 characters also. \"...the default confusables list is extremely buggy. It needs at least 7 manual exceptions for the ASCII range, 12 exceptions for Greek, and I didn\u2019t check any others scripts. python and clang-tidy were very unsuccessful with", "context": "", "use_case": "", "switched_from": "", "story": "Confusables.txt and NFKC disagree on 31 characters"}]}], "who": [{"by": "hoyhoy", "context": "C/C++ developer", "url": "https://news.ycombinator.com/item?id=46594180", "date": "2026-01-12"}], "tags": [], "use_cases": ["c++ static analysis", "c++ linting", "c code linting", "c/c++ static analysis"], "compared": [{"slug": "clang-format", "name": "clang-format", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "llvm", "name": "LLVM", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=46588837", "title": "LLVM: The Bad Parts", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=50103164", "title": "C++26 Contracts: Introduction to Preconditions and Postconditions", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48743472", "title": "Godot will no longer accept AI-authored code contributions", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47994012", "title": "Specsmaxxing \u2013 On overcoming AI psychosis, and why I write specs in YAML", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47991802", "title": "A Couple Million Lines of Haskell: Production Engineering at Mercury", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47121716", "title": "Confusables.txt and NFKC disagree on 31 characters", "mentions": 1}], "sentiment_by_month": {"2025-11": {"recommend": 2}, "2025-12": {}, "2026-01": {"recommend": 2}, "2026-02": {"warn": 1}, "2026-03": {}, "2026-04": {}, "2026-05": {"neutral": 2}, "2026-06": {}, "2026-07": {"recommend": 1}, "2026-08": {}, "2026-09": {}, "2026-10": {"neutral": 1}}, "quotes": [{"id": 801841346, "item_id": 50115084, "url": "https://news.ycombinator.com/item?id=50115084", "by": "pjmlp", "date": "2026-10-16", "stance": "neutral", "quote": "MSVC and clang-tidy have struggled to achieve the Core Guidelines ideas", "excerpt": "Yeah, the problem with the lifetimes profile vision, is the lack of acknowledgement of how MSVC and clang-tidy have struggled to achieve the Core Guidelines ideas for lifetimes (since 2015), without additional annotations. MSVC requires SAL and clang has equally added extensions for type annotations. The WG21 politics killed the Safe C++ proposal with the P3466 paper, \"(Re)affirm design principles for future C++ evol", "context": "", "use_case": "", "switched_from": "", "story": "C++26 Contracts: Introduction to Preconditions and Postconditions"}, {"id": 780351536, "item_id": 48771971, "url": "https://news.ycombinator.com/item?id=48771971", "by": "roflcopter69", "date": "2026-07-03", "stance": "recommend", "quote": "figure out good clang-tidy and clang-format rules", "excerpt": "A serious competitor wouldn't use Rust because it immediately disqualifies your engine from being shipped to consoles. At least at the moment. I know it's less of a technical limitation and more of a political one, but if you are serious about shipping your game to various platforms, you cannot use Rust. But things might be about to change, see https://akaganite.com But honestly, as of today, you're probably having a", "context": "", "use_case": "C++ linting", "switched_from": "", "story": "Godot will no longer accept AI-authored code contributions"}, {"id": 767958048, "item_id": 47997378, "url": "https://news.ycombinator.com/item?id=47997378", "by": "Stehfyn", "date": "2026-05-03", "stance": "neutral", "quote": "plus clang-tidy with very few suppressions", "excerpt": "I use a multimodal approach to defining my spec: different layers of criteria for how the software looks, behaves, what it produces, and under what constraints. For the literal code: \u2022 A healthy cocktail of /WX + /Wall, plus clang-tidy with very few suppressions \u2022 An extremely opinionated mix of clang-format and LLM-generated bespoke formatting that AST-based tools cant express \u2022 Hungarian notation; all stack locals ", "context": "", "use_case": "C code linting", "switched_from": "", "story": "Specsmaxxing \u2013 On overcoming AI psychosis, and why I write specs in YAML"}, {"id": 767946208, "item_id": 47996638, "url": "https://news.ycombinator.com/item?id=47996638", "by": "germandiago", "date": "2026-05-03", "stance": "neutral", "quote": "I use all warnings as errors, clang tidy and have a lot of flexibility", "excerpt": "Some people ask me why I do not use Rust as opposed to C++ if it is already safer and more modern. But I see the forums (and I also trued some toy stuff at times) plagued with rigidity problems that in C++ have obvious solutions. For example, I am not going to fight a borrow-checker all the stack up to get a 0.0005% perf improvement, if sny, when I can use smart pointers. I am not going to use Result everywhere when ", "context": "", "use_case": "C++ static analysis", "switched_from": "", "story": "A Couple Million Lines of Haskell: Production Engineering at Mercury"}, {"id": 754598720, "item_id": 47162420, "url": "https://news.ycombinator.com/item?id=47162420", "by": "rurban", "date": "2026-02-25", "stance": "warn", "quote": "python and clang-tidy were very unsuccessful with this approach", "excerpt": "That's a user pipeline problem. If you just check confusables without any tr39 algo you will be disappointed also. I had to patch confusables for the C/C++ proposal for about 10 characters also. \"...the default confusables list is extremely buggy. It needs at least 7 manual exceptions for the ASCII range, 12 exceptions for Greek, and I didn\u2019t check any others scripts. python and clang-tidy were very unsuccessful with", "context": "", "use_case": "", "switched_from": "", "story": "Confusables.txt and NFKC disagree on 31 characters"}, {"id": 745538881, "item_id": 46596180, "url": "https://news.ycombinator.com/item?id=46596180", "by": "cogman10", "date": "2026-01-12", "stance": "recommend", "quote": "", "excerpt": "Gentoo is calling you ;) https://wiki.gentoo.org/wiki/LLVM", "context": "", "use_case": "", "switched_from": "", "story": "LLVM: The Bad Parts"}, {"id": 745506881, "item_id": 46594180, "url": "https://news.ycombinator.com/item?id=46594180", "by": "hoyhoy", "date": "2026-01-12", "stance": "recommend", "quote": "If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong.", "excerpt": "I asked the guy working on compiler-rt to change one boolean so the LLVM 18 build would work on macOS, and he locked the whole issue down as \"heated\" and it's still not fixed four years later. I love LLVM though. clang-tidy, ASAN, UBSAN, LSAN, MSAN, and TSAN are AMAZING. If you are coding C and C++ and NOT using clang-tidy, you are doing it wrong. My biggest problem with LLVM rn is that -fbounds-safety is only availa", "context": "C/C++ developer", "use_case": "C/C++ static analysis", "switched_from": "", "story": "LLVM: The Bad Parts"}, {"id": 733754208, "item_id": 45859638, "url": "https://news.ycombinator.com/item?id=45859638", "by": "krona", "date": "2025-11-08", "stance": "recommend", "quote": "clang-tidy has a check for this", "excerpt": "clang-tidy has a check for this. https://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html MSVC and the Clang static analyzer have a analysis checks for this too. Not sure about GCC. It's worth remembering though that values can be reinitialized in C++, after move.", "context": "", "use_case": "", "switched_from": "", "story": "C++ move semantics from scratch (2022)"}, {"id": 733475072, "item_id": 45842192, "url": "https://news.ycombinator.com/item?id=45842192", "by": "actionfromafar", "date": "2025-11-06", "stance": "recommend", "quote": "foremost clang-tidy", "excerpt": "If you are working with C++ in this day and age, regardless of which compiler you use to output your actual binaries, you really owe it to yourself to compile as many source files as possible with other diagnostic tools, foremost clang-tidy. It will catch that and a lot of iffy stuff. If you want to go deeper, you can also add your own diagnostics, which can have knowledge specific to your program. https://clang.llvm", "context": "", "use_case": "C++ static analysis", "switched_from": "", "story": "A prvalue is not a temporary"}]}