improve decl merging logic to be more correct with
functions. Patch contributed by Nuno Lopes, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43757 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 40414b4..7eec3b0 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -245,6 +245,11 @@
Old->getCanonicalType() == New->getCanonicalType()) {
return New;
}
+
+ if (New->getBody() == 0 &&
+ Old->getCanonicalType() == New->getCanonicalType()) {
+ return 0;
+ }
// TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
// TODO: This is totally simplistic. It should handle merging functions