[PATCH] D105892: [NFC] Silence build warning by placing parentheses around condition

Anton Zabaznov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 06:53:32 PDT 2021


azabaznov created this revision.
azabaznov added reviewers: Anastasia, thakis.
Herald added a reviewer: aaron.ballman.
azabaznov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105892

Files:
  clang/lib/Sema/SemaDeclAttr.cpp


Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -7406,10 +7406,10 @@
     const Type *DeclTy = PDecl->getType().getCanonicalType().getTypePtr();
     if (AL.getAttrName()->getName().find("read_write") != StringRef::npos) {
       if ((!S.getLangOpts().OpenCLCPlusPlus &&
-               (S.getLangOpts().OpenCLVersion < 200) ||
-           (S.getLangOpts().OpenCLVersion == 300 &&
-            !S.getOpenCLOptions().isSupported("__opencl_c_read_write_images",
-                                              S.getLangOpts()))) ||
+           ((S.getLangOpts().OpenCLVersion < 200) ||
+            (S.getLangOpts().OpenCLVersion == 300 &&
+             !S.getOpenCLOptions().isSupported("__opencl_c_read_write_images",
+                                               S.getLangOpts())))) ||
           DeclTy->isPipeType()) {
         S.Diag(AL.getLoc(), diag::err_opencl_invalid_read_write)
             << AL << PDecl->getType() << DeclTy->isImageType();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105892.358254.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210713/d4eb03b0/attachment.bin>


More information about the cfe-commits mailing list