summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/exprs.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-08 06:51:10 +0000
committerChris Lattner <sabre@nondot.org>2009-03-08 06:51:10 +0000
commit36c39c9b0a6a54a374f54bf693a2943f80dcd9c9 (patch)
treeeb7397f79f6987d3e3a4974f6d05f412969d681b /clang/test/Sema/exprs.c
parentfbed86a865701c617425db187b757ab6b79aa588 (diff)
downloadbcm5719-llvm-36c39c9b0a6a54a374f54bf693a2943f80dcd9c9.tar.gz
bcm5719-llvm-36c39c9b0a6a54a374f54bf693a2943f80dcd9c9.zip
refine the "use of unary operator that may be intended as compound assignment (+=)"
warning to only trigger when there is whitespace or something else after the + as suggested by Eli. llvm-svn: 66370
Diffstat (limited to 'clang/test/Sema/exprs.c')
-rw-r--r--clang/test/Sema/exprs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index ba411c528da..45e146286a3 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -20,8 +20,11 @@ void test4() {
static int var;
var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}}
var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}}
- var = +5;
+ var = +5; // no warning when space between the = and +.
var = -5;
+
+ var =+5; // no warning when the subexpr of the unary op has no space before it.
+ var =-5;
}
// rdar://6319320
OpenPOWER on IntegriCloud