1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s 2 3 template<typename T, typename U> 4 struct is_same { 5 static const bool value = false; 6 }; 7 8 template<typename T> 9 struct is_same<T, T> { 10 static const bool value = true; 11 }; 12 13 const int&& foo(); 14 int i; 15 struct A { double x; }; 16 const A* a = new A(); 17 18 static_assert(is_same<decltype(foo()), const int&&>::value, ""); 19 static_assert(is_same<decltype(i), int>::value, ""); 20 static_assert(is_same<decltype(a->x), double>::value, ""); 21 static_assert(is_same<decltype((a->x)), const double&>::value, ""); 22