Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import codingstandards.cpp.Macro

from FunctionLikeMacro m, MacroInvocation mi, int i, string expanded, string param
where
not isExcluded(m, Preprocessor2Package::macroParameterUsedAsHashOperandQuery()) and
not isExcluded(mi, Preprocessor2Package::macroParameterUsedAsHashOperandQuery()) and
mi = m.getAnInvocation() and
param = m.getParameter(i) and
(
Expand All @@ -31,9 +31,6 @@ where
// This check ensure there is an expansion that is used.
expanded = mi.getExpandedArgument(i) and
not expanded = "" and
exists(Macro furtherExpandedMacro |
mi.getUnexpandedArgument(i).matches(furtherExpandedMacro.getName() + "%")
)
not mi.getUnexpandedArgument(i) = mi.getExpandedArgument(i)
select m,
"Macro " + m.getName() + " contains use of parameter " + m.getParameter(i) +
" used in multiple contexts."
"Macro " + m.getName() + " contains use of parameter " + param + " used in multiple contexts."
1 change: 1 addition & 0 deletions change_notes/2023-03-07-20-12-perf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* `Rule 20.12` - the performance of this rule has been improved.