aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/placeholder5.C
blob: e1d3092a77db31ec5fada751f735d7ecc7f4a709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-options "-std=c++1z -fconcepts" }

template <class T, class U>
concept bool Same = __is_same_as(T, U);

const int i = 0;
template <class T>
concept bool C =
  requires {
    { &i } -> const Same<T>*;
  };

template <C c>
constexpr bool f() { return true; }

static_assert(f<double>(), "");	// { dg-error "" }
static_assert(f<int>(), "");