AssignConvertType ConvTy =
CheckSingleAssignmentConstraints(ProtoArgType, Arg);
TheCall->setArg(i, Arg);
-
+
if (DiagnoseAssignmentResult(ConvTy, Arg->getLocStart(), ProtoArgType,
ArgType, Arg, "passing"))
return true;
}
// Pointee types must be compatible.
- if (!Context.typesAreCompatible(lpointee.getUnqualifiedType(),
- rpointee.getUnqualifiedType())) {
+ if (!Context.typesAreCompatible(
+ Context.getCanonicalType(lpointee).getUnqualifiedType(),
+ Context.getCanonicalType(rpointee).getUnqualifiedType())) {
Diag(loc, diag::err_typecheck_sub_ptr_compatible,
lex->getType().getAsString(), rex->getType().getAsString(),
lex->getSourceRange(), rex->getSourceRange());
--- /dev/null
+// RUN: clang %s -fsyntax-only -verify -pedantic
+
+typedef const char rchar;
+int a(char* a, rchar* b) {
+ return a-b;
+}