Testcase for PR58282
[official-gcc.git] / gcc / testsuite / g++.dg / tm / noexcept-6.C
blob4391159e23531ad866c10c51c4e9dc5d1cd2e65e
1 // { dg-do compile }
2 // { dg-options "-fno-exceptions -fgnu-tm -O -std=c++0x -fdump-tree-tmlower" }
4 struct TrueFalse
6   static constexpr bool v() { return true; }
7 };
9 int global;
11 template<typename T> int foo()
13   return __transaction_atomic noexcept(T::v()) (global + 1);
16 int f1()
18   return foo<TrueFalse>();
21 /* { dg-final { scan-tree-dump-times "eh_must_not_throw" 0 "tmlower" } } */
22 /* { dg-final { scan-tree-dump-times "__transaction_atomic" 1 "tmlower" } } */
23 /* { dg-final { cleanup-tree-dump "tmlower" } } */