yaxunl added inline comments.
================ Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8301 +def err_opencl_sampler_qualifier : Error< + "global sampler requires a const qualifier">; def err_opencl_cast_non_zero_to_event_t : Error< ---------------- global sampler requires a const or constant address space qualifier ================ Comment at: lib/Sema/SemaDecl.cpp:6085 + // space qualifier or with the const qualifier. + if (DC->isTranslationUnit() && + !(R.getAddressSpace() == LangAS::opencl_constant || ---------------- should be else if ? if the previous error already happens, it is unnecessary to do the next check https://reviews.llvm.org/D32856 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits