[clang-tools-extra] [clang-tidy] fix false positive in bugprone-return-const-ref-from-parameter (PR #117734)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 06:42:10 PST 2024


================
@@ -151,6 +151,12 @@ void instantiate(const int &param, const float &paramf, int &mut_param, float &m
         itf6(mut_paramf);
 }
 
+template<class T>
+void f(const T& t) {
+    const auto get = [&t] -> const T& { return t; };
+    return T{};
+}
----------------
jcsxky wrote:

Done.

https://github.com/llvm/llvm-project/pull/117734


More information about the cfe-commits mailing list