C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 9bf35ee..2732bf9 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -75,9 +75,13 @@
                                    SourceLocation L, 
                                    DeclarationName N, QualType T, 
                                    StorageClass S, bool isInline, 
+                                   bool hasPrototype,
                                    SourceLocation TypeSpecStartLoc) {
-  return new (C) FunctionDecl(Function, DC, L, N, T, S, isInline,
-                                TypeSpecStartLoc);
+  FunctionDecl *New 
+    = new (C) FunctionDecl(Function, DC, L, N, T, S, isInline, 
+                           TypeSpecStartLoc);
+  New->HasPrototype = hasPrototype;
+  return New;
 }
 
 BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {