gcc/testsuite/g++.dg/ubsan/pr81929.C
raw| 1 | // PR sanitizer/81929 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-std=c++14 -fsanitize=undefined" } |
| 4 | |
| 5 | struct S { S &operator<< (long); S foo (); S (); }; |
| 6 | |
| 7 | void |
| 8 | bar () |
| 9 | { |
| 10 | static_cast<S&>(S () << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 |
| 11 | << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 |
| 12 | << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 |
| 13 | << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0).foo (); |
| 14 | } |