aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/var-templ2.C
blob: ffe5f1ffe05670ec5d5fb8422532c8ba4fd4d68a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/67139
// { dg-do compile { target c++17 } }
// { dg-options "-fconcepts" }

template <class T>
constexpr typename T::type::value_type _v = T::type::value;

template <class T> concept bool IsTrue_() { return _v<T>; }

template <class T> concept bool Unpossible() {
  return IsTrue_<T &&>();
}

template <class> constexpr bool unpossible() { return false; }
Unpossible{ T }
constexpr bool unpossible() { return true; }

static_assert((!unpossible<void>()), "");