1762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
28e8fb3be5bd78f0564444eca02b404566a5f3b5dAndy Gibbs// expected-no-diagnostics
3ba69b3c1050447db3c91a41ff25ce8cd29d9b021Daniel Dunbar
44e579922ada4e19618710878c32543322f86c9c8Anders Carlssontemplate<typename T, typename U> struct is_same {
54e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  static const bool value = false;
64e579922ada4e19618710878c32543322f86c9c8Anders Carlsson};
74e579922ada4e19618710878c32543322f86c9c8Anders Carlsson
84e579922ada4e19618710878c32543322f86c9c8Anders Carlssontemplate<typename T> struct is_same<T, T> {
94e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  static const bool value = true;
104e579922ada4e19618710878c32543322f86c9c8Anders Carlsson};
114e579922ada4e19618710878c32543322f86c9c8Anders Carlsson
124e579922ada4e19618710878c32543322f86c9c8Anders Carlssonstruct S {
134e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  void f() { static_assert(is_same<decltype(this), S*>::value, ""); }
144e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  void g() const { static_assert(is_same<decltype(this), const S*>::value, ""); }
154e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  void h() volatile { static_assert(is_same<decltype(this), volatile S*>::value, ""); }
164e579922ada4e19618710878c32543322f86c9c8Anders Carlsson  void i() const volatile { static_assert(is_same<decltype(this), const volatile S*>::value, ""); }
174e579922ada4e19618710878c32543322f86c9c8Anders Carlsson};
18