1// RUN: %clang_cc1 -fsyntax-only -verify %s 2// expected-no-diagnostics 3 4// floating-point overloads 5 6__typeof__(0 + 0.0L) ld0; 7long double &ldr = ld0; 8 9__typeof__(0 + 0.0) d0; 10double &dr = d0; 11 12__typeof__(0 + 0.0f) f0; 13float &fr = f0; 14 15// integral promotions 16 17signed char c0; 18__typeof__(c0 + c0) c1; 19int &cr = c1; 20 21unsigned char uc0; 22__typeof__(uc0 + uc0) uc1; 23int &ucr = uc1; 24 25short s0; 26__typeof__(s0 + s0) s1; 27int &sr = s1; 28 29unsigned short us0; 30__typeof__(us0 + us0) us1; 31int &usr = us1; 32 33// integral overloads 34 35__typeof__(0 + 0UL) ul0; 36unsigned long &ulr = ul0; 37 38template<bool T> struct selector; 39template<> struct selector<true> { typedef long type; }; 40template<> struct selector<false> {typedef unsigned long type; }; 41__typeof__(0U + 0L) ui_l0; 42selector<(sizeof(long) > sizeof(unsigned int))>::type &ui_lr = ui_l0; 43 44__typeof__(0 + 0L) l0; 45long &lr = l0; 46 47__typeof__(0 + 0U) u0; 48unsigned &ur = u0; 49 50__typeof__(0 + 0) i0; 51int &ir = i0; 52