Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -7981,6 +7981,14 @@ DefaultFunctionArrayLvalueConversion(FirstArg); if (FirstArgResult.isInvalid()) return true; + QualType firstArgType = FirstArgResult.get()->getType(); + + if (!firstArgType->isAnyPointerType()) { + QualType expectedType = Context.getPointerType(firstArgType); + return Diag(FirstArg->getBeginLoc(), + diag::err_typecheck_convert_incompatible) + << firstArgType << expectedType << 1 << 0 << 0; + } TheCall->setArg(0, FirstArgResult.get()); }