[clang] [clang-tools-extra] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 9 15:24:14 PST 2023


=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/73069 at github.com>


================
@@ -0,0 +1,141 @@
+// RUN: %check_clang_tidy %s readability-redundant-inline-specifier -std=c++17 %t
+
+template <typename T> inline T f()
----------------
PiotrZSL wrote:

according to C++ insights this inline is not redundant, please verify.
Wont inline keyword force change here of linkage to internal ?
Maybe this should also be checked.

Simply because if i call this function from one file, and then i use forward declaration in other file, then without inline keyword code may still compile and symbol will be emitted.

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


More information about the cfe-commits mailing list