[clang] Sema: detect adjusted function prototypes to fix crash with __typeof + __asm + noreturn (#173598) (PR #174092)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 31 22:21:04 PST 2025
================
@@ -9529,12 +9529,23 @@ static FunctionDecl *CreateNewFunctionDecl(Sema &SemaRef, Declarator &D,
// declarator to still have a function type. e.g.,
// typedef void func(int a);
// __attribute__((noreturn)) func other_func; // This has a prototype
+ auto HasFunctionPrototype = [&](QualType T) -> bool {
----------------
shafik wrote:
This does not looks like a good simplification to me. I either would not have bothered and just added the `isNull()` check below or I would have created a lambda that takes `D` and `R` from below by reference and did the whole set of checks and assigned that result to `HasPrototype`.
https://github.com/llvm/llvm-project/pull/174092
More information about the cfe-commits
mailing list