diff options
author | Mike Stump <mrs@apple.com> | 2007-05-08 01:31:24 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2007-05-08 01:31:24 +0000 |
commit | 841cc7daf3e285036b0468ce9eb28695a8080e98 (patch) | |
tree | 37e00df220b8ab9eb5ac7e99af6a2be48f9819c4 /gcc/testsuite/g++.old-deja | |
parent | 79d37e4574ed6ca0c6fbd189b62f84cb8e90450a (diff) | |
download | gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.zip gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.tar.gz gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.tar.bz2 |
invoke.texi (Warning Options): Document that -Wempty-body also checks for and while statements in C++.
* doc/invoke.texi (Warning Options): Document that -Wempty-body
also checks for and while statements in C++.
cp:
* parser.c (check_empty_body): Add.
(cp_parser_iteration_statement): Add call to check_empty_body.
testsuite:
* g++.old-deja/g++.mike/empty.C: Add.
From-SVN: r124534
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/empty.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/empty.C b/gcc/testsuite/g++.old-deja/g++.mike/empty.C new file mode 100644 index 0000000..d69f3ad --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/empty.C @@ -0,0 +1,25 @@ +// { dg-options "-W" } + +#define NOPE + +void foo() { + while (1); /* { dg-error "suggest a space before " } */ + { + } + for (;;); /* { dg-error "suggest a space before " } */ + { + } + while (1) + ; + for (;;) + ; + while (1) ; + for (;;) ; + /* These two work when using mapped locations */ + while (1) NOPE; /* { dg-bogus "suggest a space before " "suggest" { xfail *-*-* } } */ + for (;;) NOPE; /* { dg-bogus "suggest a space before " "suggest" { xfail *-*-* } } */ + while (1) + NOPE; + for (;;) + NOPE; +} |