summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/noexcept-6.C
blob: dd9845c093d85b2fef27fb0bd74c701f04f517ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do compile { target c++11 } }
// { dg-options "-fno-exceptions -fgnu-tm -O -fdump-tree-tmlower" }

struct TrueFalse
{
  static constexpr bool v() { return true; }
};

int global;

template<typename T> int foo()
{
  return __transaction_atomic noexcept(T::v()) (global + 1);
}

int f1()
{
  return foo<TrueFalse>();
}

/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 0 "tmlower" } } */
/* { dg-final { scan-tree-dump-times "__transaction_atomic" 1 "tmlower" } } */
/* { dg-final { cleanup-tree-dump "tmlower" } } */