Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/class-deduction76.C

raw
1 // PR c++/90799
2 // { dg-do compile { target c++17 } }
3
4 template<class T>
5 void foo() noexcept(T::value);
6
7 struct S {
8 static constexpr const bool value = true;
9
10 template<class T>
11 void bar() noexcept(T::value);
12 };
13
14 template<class... Args, bool is_noexcept>
15 constexpr bool is_noexcept_function(void(Args...) noexcept(is_noexcept)) noexcept {
16 return is_noexcept;
17 }
18
19 template<class... Args, bool is_noexcept>
20 constexpr bool is_noexcept_member_function(void(S::*)(Args...) noexcept(is_noexcept)) noexcept {
21 return is_noexcept;
22 }
23
24 static_assert(is_noexcept_function(foo<S>));