File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ void UseInternalLinkageCheck::registerMatchers(MatchFinder *Finder) {
125125 exportDecl ()))))));
126126 Finder->addMatcher (
127127 functionDecl (Common, hasBody (),
128- unless (anyOf (cxxMethodDecl (),
128+ unless (anyOf (cxxMethodDecl (), isConsteval (),
129129 isAllocationOrDeallocationOverloadedFunction (),
130130 isMain ())))
131131 .bind (" fn" ),
Original file line number Diff line number Diff line change @@ -286,9 +286,9 @@ Changes in existing checks
286286
287287- Improved :doc: `misc-use-internal-linkage
288288 <clang-tidy/checks/misc/use-internal-linkage>` check to insert ``static ``
289- keyword before type qualifiers such as ``const `` and ``volatile `` and fix
290- false positives for function declaration without body and fix false positives
291- for C++20 export declarations and fix false positives for global scoped
289+ keyword before type qualifiers such as ``const `` and ``volatile ``. Also, fix
290+ false positives for function declaration without body, C++20 consteval
291+ functions, C++20 export declarations, and global scoped
292292 overloaded ``operator new `` and ``operator delete ``.
293293
294294- Improved :doc: `modernize-avoid-c-arrays
Original file line number Diff line number Diff line change 1+ // RUN: %check_clang_tidy -std=c++20 %s misc-use-internal-linkage %t -- -- -I%S/Inputs/use-internal-linkage
2+
3+ consteval void gh122096 () {}
4+
5+ constexpr void cxf () {}
6+ // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: function 'cxf'
7+ // CHECK-FIXES: static constexpr void cxf() {}
You can’t perform that action at this time.
0 commit comments