aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C
blob: 005aa80fc093adf6394013c9122182094bcdbb9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/80562
// { dg-do compile { target c++17 } }

struct T {
  int i;
  constexpr auto foo() { return false; }
};

template <class MustBeTemplate>
constexpr auto bf(T t) {
    if constexpr(t.foo()) {
        return false;
    }
    return true;
}