blob: 21b4b60ea3cee3f42c472cac5a1c1ddb42ead51c [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Daniel Dunbarba69b3c2009-11-14 03:24:04 +00003
Anders Carlsson4e579922009-07-10 21:35:09 +00004template<typename T, typename U> struct is_same {
5 static const bool value = false;
6};
7
8template<typename T> struct is_same<T, T> {
9 static const bool value = true;
10};
11
12struct 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, ""); }
17};