Skip to content

Commit af1da1e

Browse files
committed
C++: Also support the __noreturn__ attribute in exits
Observed this attribute while working on coding standards test regression when replacing Guards by IRGuards.
1 parent 1bc6f88 commit af1da1e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cpp/ql/lib/DefaultOptions.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ class Options extends string {
5252
/**
5353
* Holds if a call to this function will never return.
5454
*
55-
* By default, this holds for `exit`, `_exit`, `abort`, `__assert_fail`,
56-
* `longjmp`, `__builtin_unreachable` and any function with a
57-
* `noreturn` attribute or specifier.
55+
* By default, this holds for `exit`, `_exit`, `_Exit`, `abort`,
56+
* `__assert_fail`, `longjmp`, `__builtin_unreachable` and any
57+
* function with a `noreturn` or `__noreturn__` attribute or
58+
* `noreturn` specifier.
5859
*/
5960
predicate exits(Function f) {
60-
f.getAnAttribute().hasName("noreturn")
61+
f.getAnAttribute().hasName(["noreturn", "__noreturn__"])
6162
or
6263
f.getASpecifier().hasName("noreturn")
6364
or

0 commit comments

Comments
 (0)