summaryrefslogtreecommitdiff
path: root/test/SemaCXX/subst-restrict.cpp
blob: aab6872d8de8a32937650d76d48baf643085c974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_cc1 -std=c++17 -verify %s

// expected-no-diagnostics

template <class T> struct add_restrict {
  typedef T __restrict type;
};

template <class T, class V> struct is_same {
  static constexpr bool value = false;
};

template <class T> struct is_same<T, T> {
  static constexpr bool value = true;
};

static_assert(is_same<int & __restrict, add_restrict<int &>::type>::value, "");
static_assert(is_same<int(), add_restrict<int()>::type>::value, "");