Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -3466,6 +3466,18 @@ return false; // Fall through for conflicting redeclarations and redefinitions. + } else if (getLangOpts().OpenCL) { + QualType OldDeclaredReturnType = Old->getDeclaredReturnType(); + QualType NewDeclaredReturnType = New->getDeclaredReturnType(); + + if (!Context.hasSameType(OldDeclaredReturnType, NewDeclaredReturnType) && + canFullyTypeCheckRedeclaration(New, Old, NewDeclaredReturnType, + OldDeclaredReturnType)) { + + Diag(New->getLocation(), diag::err_ovl_diff_return_type) + << New->getReturnTypeSourceRange(); + return true; + } } // C: Function types need to be compatible, not identical. This handles