================ @@ -0,0 +1,26 @@ +.. title:: clang-tidy - readability-mark-static + +readability-mark-static +======================= + +Detects variable and function can be marked as static. + +Static functions and variables are scoped to a single file. Marking functions +and variables as static helps to better remove dead code. In addition, it gives +the compiler more information and can help compiler make more aggressive +optimizations. + ---------------- firewave wrote:
Did some research but did not find the case I remembered (it might have variable templates though): - anonymous namespaces do not have external linkage until C++11: https://en.cppreference.com/w/cpp/language/namespace#Unnamed_namespaces / https://en.cppreference.com/w/cpp/language/storage_duration#Linkage - `static` variable templates do not have internal linkage until C++14: https://en.cppreference.com/w/cpp/language/storage_duration#Linkage Interesting tidbit that enumerations have external linkage. https://github.com/llvm/llvm-project/pull/90830 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits