blob: a13416f089dd6b3ccf1c8f7c26b53f30a1f62c89 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
Daniel Dunbarba69b3c2009-11-14 03:24:04 +00002
Anders Carlsson4e579922009-07-10 21:35:09 +00003template<typename T, typename U> struct is_same {
4 static const bool value = false;
5};
6
7template<typename T> struct is_same<T, T> {
8 static const bool value = true;
9};
10
11struct S {
12 void f() { static_assert(is_same<decltype(this), S*>::value, ""); }
13 void g() const { static_assert(is_same<decltype(this), const S*>::value, ""); }
14 void h() volatile { static_assert(is_same<decltype(this), volatile S*>::value, ""); }
15 void i() const volatile { static_assert(is_same<decltype(this), const volatile S*>::value, ""); }
16};