[PATCH] D105890: Add paranthesis around logical expression to silence -Wlogical-op-parentheses warning.

Bogdan Graur via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 06:04:15 PDT 2021


bgraur created this revision.
Herald added a reviewer: aaron.ballman.
bgraur 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/D105890

Files:
  clang/lib/Sema/SemaDeclAttr.cpp


Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -7405,8 +7405,8 @@
   if (const auto *PDecl = dyn_cast<ParmVarDecl>(D)) {
     const Type *DeclTy = PDecl->getType().getCanonicalType().getTypePtr();
     if (AL.getAttrName()->getName().find("read_write") != StringRef::npos) {
-      if ((!S.getLangOpts().OpenCLCPlusPlus &&
-               (S.getLangOpts().OpenCLVersion < 200) ||
+      if (((!S.getLangOpts().OpenCLCPlusPlus &&
+            (S.getLangOpts().OpenCLVersion < 200)) ||
            (S.getLangOpts().OpenCLVersion == 300 &&
             !S.getOpenCLOptions().isSupported("__opencl_c_read_write_images",
                                               S.getLangOpts()))) ||


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


More information about the cfe-commits mailing list