This fixes a crash on the included testcase (found in NetHack).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51767
91177308-0d34-0410-b5e6-
96231b3b80d8
bool isDefinition) {
// See if it is already in the map. If so, just return it.
llvm::Constant *&Entry = GlobalDeclMap[D];
- if (Entry) return Entry;
+ if (!isDefinition && Entry) return Entry;
const llvm::Type *Ty = getTypes().ConvertType(D->getType());
--- /dev/null
+// RUN: clang %s -emit-llvm
+
+static int staticfun(void);
+int (*staticuse1)(void) = staticfun;
+static int staticfun() {return 1;}
+int (*staticuse2)(void) = staticfun;