diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wnonnull2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wnonnull2.C | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wnonnull2.C b/gcc/testsuite/g++.dg/warn/Wnonnull2.C new file mode 100644 index 00000000000..6757437de12 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wnonnull2.C @@ -0,0 +1,9 @@ +// PR c++/68767 +// { dg-options "-Wnonnull" } + +extern int len (const char*) __attribute__ ((__nonnull__ (1))); + +int f (int x) +{ + return len ((x ? "x" : 0) ? (x ? "x" : 0) : "x"); +} |