1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2
3template<typename T, typename U>
4struct is_same {
5  static const bool value = false;
6};
7
8template<typename T>
9struct is_same<T, T> {
10  static const bool value = true;
11};
12
13const int&& foo();
14int i;
15struct A { double x; };
16const A* a = new A();
17
18static_assert(is_same<decltype(foo()), const int&&>::value, "");
19static_assert(is_same<decltype(i), int>::value, "");
20static_assert(is_same<decltype(a->x), double>::value, "");
21static_assert(is_same<decltype((a->x)), const double&>::value, "");
22static_assert(is_same<decltype(static_cast<int&&>(i)), int&&>::value, "");
23
24int f0(int); // expected-note{{possible target}}
25float f0(float); // expected-note{{possible target}}
26
27decltype(f0) f0_a; // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
28