Fix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualified parameter types (per C99 6.7.5.3p15).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46472 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 242a684..c86cf67 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -1579,7 +1579,10 @@
// The use of ellipsis agree...now check the argument types.
for (unsigned i = 0; i < lproto_nargs; i++)
- if (!typesAreCompatible(lproto->getArgType(i), rproto->getArgType(i)))
+ // C99 6.7.5.3p15: ...and each parameter declared with qualified type
+ // is taken as having the unqualified version of it's declared type.
+ if (!typesAreCompatible(lproto->getArgType(i).getUnqualifiedType(),
+ rproto->getArgType(i).getUnqualifiedType()))
return false;
return true;
}