Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept84.C
blob06f33264f77ccf2d6ff73d935a54289843ff0d76
1 // PR c++/114114
2 // { dg-do compile { target c++11 } }
4 template<bool B>
5 constexpr void
6 test ()
8   constexpr bool is_yes = B;
9   struct S {
10     constexpr S() noexcept(is_yes) { }
11   };
12   S s;
15 constexpr bool foo() { return true; }
17 template<typename T>
18 constexpr void
19 test2 ()
21   constexpr T (*pfn)() = &foo;
22   struct S {
23     constexpr S() noexcept(pfn()) { }
24   };
25   S s;
28 int main()
30   test<true>();
31   test2<bool>();