diff options
-rw-r--r-- | src/ir/function.rs | 4 | ||||
-rw-r--r-- | tests/headers/noreturn.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs index 6b59649c..b829e601 100644 --- a/src/ir/function.rs +++ b/src/ir/function.rs @@ -381,7 +381,9 @@ impl FunctionSig { ) -> Result<Self, ParseError> { use clang_sys::*; debug!("FunctionSig::from_ty {:?} {:?}", ty, cursor); - let is_divergent = cursor.has_no_return_attr(); + + let is_divergent = ctx.options().enable_function_attribute_detection && + cursor.has_no_return_attr(); // Skip function templates let kind = cursor.kind(); diff --git a/tests/headers/noreturn.h b/tests/headers/noreturn.h index 9ce68518..0e4819e2 100644 --- a/tests/headers/noreturn.h +++ b/tests/headers/noreturn.h @@ -1,3 +1,4 @@ +// bindgen-flags: --enable-function-attribute-detection _Noreturn void f(void); // TODO (pvdrz): figure out how to handle this case. __attribute__((noreturn)) void g(void); |