From af1da1e9ae834fabe5b4817437e6a2d24d342143 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 6 Dec 2023 18:08:39 +0100 Subject: [PATCH] C++: Also support the `__noreturn__` attribute in `exits` Observed this attribute while working on coding standards test regression when replacing Guards by IRGuards. --- cpp/ql/lib/DefaultOptions.qll | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/ql/lib/DefaultOptions.qll b/cpp/ql/lib/DefaultOptions.qll index 5b46e0cd4a3..dd6fe38e792 100644 --- a/cpp/ql/lib/DefaultOptions.qll +++ b/cpp/ql/lib/DefaultOptions.qll @@ -52,12 +52,13 @@ class Options extends string { /** * Holds if a call to this function will never return. * - * By default, this holds for `exit`, `_exit`, `abort`, `__assert_fail`, - * `longjmp`, `__builtin_unreachable` and any function with a - * `noreturn` attribute or specifier. + * By default, this holds for `exit`, `_exit`, `_Exit`, `abort`, + * `__assert_fail`, `longjmp`, `__builtin_unreachable` and any + * function with a `noreturn` or `__noreturn__` attribute or + * `noreturn` specifier. */ predicate exits(Function f) { - f.getAnAttribute().hasName("noreturn") + f.getAnAttribute().hasName(["noreturn", "__noreturn__"]) or f.getASpecifier().hasName("noreturn") or