From 00d8a100515db3cf39cc8531bf5964e81b98fc64 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:42:30 +0000 Subject: [PATCH] C++: Add Function.hasAmbiguousReturnType. --- cpp/ql/lib/semmle/code/cpp/Function.qll | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/Function.qll b/cpp/ql/lib/semmle/code/cpp/Function.qll index 10b156e3fb6..b5ea5b3cbc7 100644 --- a/cpp/ql/lib/semmle/code/cpp/Function.qll +++ b/cpp/ql/lib/semmle/code/cpp/Function.qll @@ -524,6 +524,14 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function { not exists(NewOrNewArrayExpr new | e = new.getAllocatorCall().getArgument(0)) ) } + + /** + * Holds if this function has ambiguous return type (this occurs sometimes in + * Build Mode None). + */ + predicate hasAmbiguousReturnType() { + count(this.getType()) != 1 + } } pragma[noinline]