================
@@ -9529,12 +9529,28 @@ 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
-    bool HasPrototype =
-        (D.isFunctionDeclarator() && D.getFunctionTypeInfo().hasPrototype) ||
-        (D.getDeclSpec().isTypeRep() &&
-         SemaRef.GetTypeFromParser(D.getDeclSpec().getRepAsType(), nullptr)
-             ->isFunctionProtoType()) ||
-        (!R->getAsAdjusted<FunctionType>() && R->isFunctionProtoType());
+    // Determine whether the function was written with a prototype. We
+    // consider several sources: an explicit prototype in the declarator,
+    // a typedef reference that resolves to a function prototype, or the
+    // result type `R` being a function prototype.
----------------
Sirraide wrote:

I don’t think this comment adds any additional information that isn’t already 
in the comment above

https://github.com/llvm/llvm-project/pull/174092
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to