1 // RUN: %clang_cc1 -verify -fsyntax-only %s
2 // expected-no-diagnostics
6 static_assert(__is_same(decltype(this), C
*__restrict
));
8 static_assert(__is_same(decltype(this), C
*__restrict
));
9 (void) [this]() { static_assert(__is_same(decltype(this), C
*__restrict
)); };
11 // By-value capture means 'this' is now a different object; do not
12 // make it __restrict.
13 (void) [*this]() { static_assert(__is_same(decltype(this), const C
*)); };
14 (void) [*this]() mutable { static_assert(__is_same(decltype(this), C
*)); };
19 template <typename T
> struct TC
{
21 static_assert(__is_same(decltype(this), TC
<int> *__restrict
));
23 static_assert(__is_same(decltype(this), TC
<int> *__restrict
));
24 (void) [this]() { static_assert(__is_same(decltype(this), TC
<int> *__restrict
)); };
26 // By-value capture means 'this' is now a different object; do not
27 // make it __restrict.
28 (void) [*this]() { static_assert(__is_same(decltype(this), const TC
<int> *)); };
29 (void) [*this]() mutable { static_assert(__is_same(decltype(this), TC
<int> *)); };
40 void member() __restrict
{
41 Foo
*__restrict This
= this;
49 void f() const __restrict
{
50 static_assert(__is_same(decltype((v
)), const int&));
51 (void) [this]() { static_assert(__is_same(decltype((v
)), const int&)); };
66 void C::g() __restrict
{