aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction76.C
blob: a131a386baa7d6ba7afb0878f36fd23f4cebc0a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/90799
// { dg-do compile { target c++17 } }

template<class T>
void foo() noexcept(T::value);

struct S {
    static constexpr const bool value = true;

    template<class T>
    void bar() noexcept(T::value);
};

template<class... Args, bool is_noexcept>
constexpr bool is_noexcept_function(void(Args...) noexcept(is_noexcept)) noexcept {
    return is_noexcept;
}

template<class... Args, bool is_noexcept>
constexpr bool is_noexcept_member_function(void(S::*)(Args...) noexcept(is_noexcept)) noexcept {
    return is_noexcept;
}

static_assert(is_noexcept_function(foo<S>));