From 6b2c415cd2e007cd78d458187eb2efc9afc84871 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Fri, 7 Jun 2024 09:28:11 +0100 Subject: [PATCH] Exclude compiler generated elements or elements from uninstantiated templates --- cpp/common/src/codingstandards/cpp/Exclusions.qll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/common/src/codingstandards/cpp/Exclusions.qll b/cpp/common/src/codingstandards/cpp/Exclusions.qll index b718f6535d..4195278028 100644 --- a/cpp/common/src/codingstandards/cpp/Exclusions.qll +++ b/cpp/common/src/codingstandards/cpp/Exclusions.qll @@ -19,6 +19,12 @@ predicate isExcluded(Element e, Query query) { isExcluded(e, query, _) } bindingset[e, query] predicate isExcluded(Element e, Query query, string reason) { + e.isFromUninstantiatedTemplate(_) and reason = "Element is from an uninstantiated template." + or + e.(Variable).isCompilerGenerated() and reason = "Element is compiler generated." + or + e.(Function).isCompilerGenerated() and reason = "Element is compiler generated." + or e instanceof ExcludedElement and reason = "Element is an excluded element." or e.getFile() instanceof ExcludedFile and reason = "Element is part of an excluded file."