[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / decltype-this.cpp
blob21b4b60ea3cee3f42c472cac5a1c1ddb42ead51c
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // expected-no-diagnostics
4 template<typename T, typename U> struct is_same {
5 static const bool value = false;
6 };
8 template<typename T> struct is_same<T, T> {
9 static const bool value = true;
12 struct S {
13 void f() { static_assert(is_same<decltype(this), S*>::value, ""); }
14 void g() const { static_assert(is_same<decltype(this), const S*>::value, ""); }
15 void h() volatile { static_assert(is_same<decltype(this), volatile S*>::value, ""); }
16 void i() const volatile { static_assert(is_same<decltype(this), const volatile S*>::value, ""); }