aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/subst-restrict.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/subst-restrict.cpp')
-rw-r--r--test/SemaCXX/subst-restrict.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/subst-restrict.cpp b/test/SemaCXX/subst-restrict.cpp
new file mode 100644
index 000000000000..aab6872d8de8
--- /dev/null
+++ b/test/SemaCXX/subst-restrict.cpp
@@ -0,0 +1,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, "");