summaryrefslogtreecommitdiffstats
path: root/test/Sema/parentheses.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/parentheses.c')
-rw-r--r--test/Sema/parentheses.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/parentheses.c b/test/Sema/parentheses.c
index 6d6fa1d..b45d851 100644
--- a/test/Sema/parentheses.c
+++ b/test/Sema/parentheses.c
@@ -37,3 +37,7 @@ void bitwise_rel(unsigned i) {
(void)(i && i || 0); // no warning.
(void)(0 || i && i); // no warning.
}
+
+// RUN: %clang_cc1 -fsyntax-only -Wparentheses -Werror -fdiagnostics-show-option %s 2>&1 | FileCheck %s
+// CHECK: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
+
OpenPOWER on IntegriCloud