// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; #define JOIN2(X,Y) X##Y #define JOIN(X,Y) JOIN2(X,Y) #define CHECK_EQUAL_TYPES(T1, T2) \ int JOIN(array,__LINE__)[is_same::value? 1 : -1] int i; typedef int& LRI; typedef int&& RRI; typedef LRI& r1; CHECK_EQUAL_TYPES(r1, int&); typedef const LRI& r2; CHECK_EQUAL_TYPES(r2, int&); typedef const LRI&& r3; CHECK_EQUAL_TYPES(r3, int&); typedef RRI& r4; CHECK_EQUAL_TYPES(r4, int&); typedef RRI&& r5; CHECK_EQUAL_TYPES(r5, int&&);