aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ubsan/pr81929.C
blob: 90f2628c41dbba17bfaace582762a0dbfd8e556f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR sanitizer/81929
// { dg-do compile }
// { dg-options "-std=c++14 -fsanitize=undefined" }

struct S { S &operator<< (long); S foo (); S (); };

void
bar ()
{
  static_cast<S&>(S () << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
		       << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
		       << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
		       << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0).foo ();
}