Clang Project

clang_source_code/test/SemaCXX/subst-restrict.cpp
1// RUN: %clang_cc1 -std=c++17 -verify %s
2
3// expected-no-diagnostics
4
5template <class T> struct add_restrict {
6  typedef T __restrict type;
7};
8
9template <class T, class V> struct is_same {
10  static constexpr bool value = false;
11};
12
13template <class T> struct is_same<T, T> {
14  static constexpr bool value = true;
15};
16
17static_assert(is_same<int & __restrict, add_restrict<int &>::type>::value, "");
18static_assert(is_same<int(), add_restrict<int()>::type>::value, "");
19