F f;
where F is a typedef of a function type, then the function "f" has a
prototype. This is a slight tweak to Chris's suggested fix in
PR3817. Fixes PR3817 and PR3840.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67313
91177308-0d34-0410-b5e6-
96231b3b80d8
isVirtualOkay = (SC != FunctionDecl::Static);
} else {
- bool HasPrototype =
+ bool HasPrototype =
getLangOptions().CPlusPlus ||
- (D.getNumTypeObjects() && D.getTypeObject(0).Fun.hasPrototype);
+ (D.getNumTypeObjects() && D.getTypeObject(0).Fun.hasPrototype) ||
+ !isa<FunctionType>(R.getTypePtr());
NewFD = FunctionDecl::Create(Context, DC,
D.getIdentifierLoc(),
{
return x == 1;
}
+
+// PR3817
+void *h0(unsigned a0, ...);
+extern __typeof (h0) h1 __attribute__((__sentinel__));
+extern __typeof (h1) h1 __attribute__((__sentinel__));
+
+// PR3840
+void i0 (unsigned short a0);
+extern __typeof (i0) i1;
+extern __typeof (i1) i1;