================
@@ -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 {
+ if (T.isNull())
+ return false;
+ if (T->getAs<FunctionProtoType>())
+ return true;
+ if (const FunctionType *Adjusted = T->getAsAdjusted<FunctionType>())
+ return isa<FunctionProtoType>(Adjusted);
----------------
DhanashreePetare wrote:
Thanks for pointing it @Sirraide , I removed the getAsAdjusted usage and
refactored the prototype detection into a small helper that uses
[getAs<FunctionProtoType>()](vscode-file://vscode-app/d:/Users/dhana/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
on the parsed rep-type and on
[R](vscode-file://vscode-app/d:/Users/dhana/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
(with null guards). That avoids relying on adjusted types and keeps the intent
explicit — does that address your concern?
https://github.com/llvm/llvm-project/pull/174092
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits