From ab663522fb650a70a5b1ce83a138d876220a55b5 Mon Sep 17 00:00:00 2001 From: Mariya Podchishchaeva Date: Fri, 2 Oct 2020 14:01:53 +0300 Subject: [PATCH] [NFC][SYCL] Remove unnecessary if condition This if condition duplicates logic of outer if. --- clang/lib/Sema/SemaDeclAttr.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 8925c3ff895d0..63de5319a30f1 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -8310,10 +8310,8 @@ void Sema::ProcessDeclAttributeList(Scope *S, Decl *D, Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; D->setInvalidDecl(); } else if (const auto *A = D->getAttr()) { - if (!getLangOpts().SYCLIsDevice) { - Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; - D->setInvalidDecl(); - } + Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; + D->setInvalidDecl(); } else if (!D->hasAttr()) { if (const auto *A = D->getAttr()) { Diag(D->getLocation(), diag::err_attribute_wrong_decl_type)