jfb added inline comments.
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-do-not-refer-atomic-twice.cpp:10 +_Atomic int n2 = ATOMIC_VAR_INIT(0); +_Atomic(int) n3 = ATOMIC_VAR_INIT(0); + ---------------- Can you cover `std::atomic` as well? ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-do-not-refer-atomic-twice.cpp:10 +_Atomic int n2 = ATOMIC_VAR_INIT(0); +_Atomic(int) n3 = ATOMIC_VAR_INIT(0); + ---------------- jfb wrote: > Can you cover `std::atomic` as well? We deprecated `ATOMIC_VAR_INIT` in C++20 and C17, I wouldn't use it here (even if it's just your own macro). ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-do-not-refer-atomic-twice.cpp:77 + n3++; +} ---------------- Can you check that non-atomic-accesses to the variable also work, for example taking the atomic's address, using it in unevaluated `sizeof` / `offsetof`, etc. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77493/new/ https://reviews.llvm.org/D77493 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits