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) {
125
125
exportDecl ()))))));
126
126
Finder->addMatcher (
127
127
functionDecl (Common, hasBody (),
128
- unless (anyOf (cxxMethodDecl (),
128
+ unless (anyOf (cxxMethodDecl (), isConsteval (),
129
129
isAllocationOrDeallocationOverloadedFunction (),
130
130
isMain ())))
131
131
.bind (" fn" ),
Original file line number Diff line number Diff line change @@ -286,9 +286,9 @@ Changes in existing checks
286
286
287
287
- Improved :doc: `misc-use-internal-linkage
288
288
<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
292
292
overloaded ``operator new `` and ``operator delete ``.
293
293
294
294
- 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