The three checks mentioned in the Title are two noisy if the code uses intrusive smart (reference counting) pointers. LLVM/Clang is such a code, it has lots of such types, e.g. StringRef, SymbolRef or ProgramStateRef, all of them based llvm::IntrusiveRefCntPtr. Every time such a type is passed as parameter, used for initialization or in a range-based for loop a false positive warning is issued together with an (unnecessary) fix.
This patch changes the term "expensive to copy" to also regard the size of the type so it disables warnings and fixes if the type is not greater than a pointer. This removes false positives for intrusive smart pointers. False positives for non-intrusive smart pointers are not addressed in this patch.
Please make that comment a sentence, and maybe don't use not twice.
What do you think about making this parameter configurable and/or set it in relation to the size of a cache-line.
This is of course target dependent, but given the CPU effects more accurate.