[PATCH] D65192: [Sema] Disable some enabled-by-default -Wparentheses diagnostics

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 19:22:38 PDT 2019


MaskRay updated this revision to Diff 212265.
MaskRay edited the summary of this revision.
MaskRay added a comment.

keep -Woverloaded-shift-op-parentheses enabled by default


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65192/new/

https://reviews.llvm.org/D65192

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  test/Misc/warning-flags-enabled.c
  test/Parser/cxx2a-spaceship.cpp
  test/SemaCXX/parentheses.cpp


Index: test/SemaCXX/parentheses.cpp
===================================================================
--- test/SemaCXX/parentheses.cpp
+++ test/SemaCXX/parentheses.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify -Wlogical-op-parentheses %s
 
 // PR16930, PR16727:
 template<class Foo>
Index: test/Parser/cxx2a-spaceship.cpp
===================================================================
--- test/Parser/cxx2a-spaceship.cpp
+++ test/Parser/cxx2a-spaceship.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++2a -verify %s
+// RUN: %clang_cc1 -std=c++2a -verify -Wparentheses %s
 
 template<int> struct X {};
 
Index: test/Misc/warning-flags-enabled.c
===================================================================
--- test/Misc/warning-flags-enabled.c
+++ test/Misc/warning-flags-enabled.c
@@ -36,7 +36,7 @@
 
 // Test if -Wshift-op-parentheses is a subgroup of -Wparentheses
 // RUN: diagtool show-enabled --no-levels -Wno-parentheses -Wshift-op-parentheses %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s
-// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s
+// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s
 // RUN: diagtool show-enabled --no-levels -Wno-parentheses %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s
 //
 // CHECK-SHIFT-OP-PARENTHESES: -Wshift-op-parentheses
Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -5630,10 +5630,10 @@
   "remove constant to silence this warning">;
 
 def warn_bitwise_op_in_bitwise_op : Warning<
-  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
+  "'%0' within '%1'">, InGroup<BitwiseOpParentheses>, DefaultIgnore;
 
 def warn_logical_and_in_logical_or : Warning<
-  "'&&' within '||'">, InGroup<LogicalOpParentheses>;
+  "'&&' within '||'">, InGroup<LogicalOpParentheses>, DefaultIgnore;
 
 def warn_overloaded_shift_in_comparison :Warning<
   "overloaded operator %select{>>|<<}0 has higher precedence than "
@@ -5644,7 +5644,7 @@
 
 def warn_addition_in_bitshift : Warning<
   "operator '%0' has lower precedence than '%1'; "
-  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
+  "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>, DefaultIgnore;
 
 def warn_self_assignment_builtin : Warning<
   "explicitly assigning value of variable of type %0 to itself">,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65192.212265.patch
Type: text/x-patch
Size: 2577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190730/56d2d881/attachment.bin>


More information about the cfe-commits mailing list