diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/error24.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/error24.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/error24.C b/gcc/testsuite/g++.dg/other/error24.C new file mode 100644 index 000000000..54343c502 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error24.C @@ -0,0 +1,13 @@ +// PR c++/34965 +// { dg-do compile } +// { dg-options "-O" } + +int foo (int); + +void +bar (int i, int j, double k) +{ + foo (i && j) (); // { dg-error "\\(\\(?i != 0\\)? \\&\\& \\(?j != 0\\)?\\)" } + foo (!i || !j) (); // { dg-error "\\(\\(?i == 0\\)? \\|\\| \\(?j == 0\\)?\\)" } + foo (!i == !j) (); // { dg-error "\\(\\(?i != 0\\)? \\^ \\(?j == 0\\)?\\)" } +} |