aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
blob: 594d3a98672da5229fd9a3cacbe5e09016fd998c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR c++/36870
// { dg-do run }


#include <cassert>

struct S { const S& operator= (const S&); };

bool f ();

int main ()
{
  assert (__has_nothrow_assign (S) == f ());
  return 0;
}

const S& S::operator= (const S&a) { return a; }

bool f () { return __has_nothrow_assign (S); }