[clang] Sema: detect adjusted function prototypes to fix crash with __typeof + __asm + noreturn (#173598) (PR #174092)

Dhanashree Petare via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 2 05:41:26 PST 2026


================
@@ -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 {
----------------
DhanashreePetare wrote:

Thanks for the review, @shafik Asper the suggestion I refactored the prototype detection into a small helper that examines [D](vscode-file://vscode-app/d:/Users/dhana/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) and [R](vscode-file://vscode-app/d:/Users/dhana/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html), and added a release-note entry.
PTAL when you have time.

https://github.com/llvm/llvm-project/pull/174092


More information about the cfe-commits mailing list