integer-literal-printing.cpp revision 0d3317e0a2e0adb57ce8d075ebdcb41a3f939805
111cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu// RUN: %clang_cc1 %s -fsyntax-only -verify
211cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu
311cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu// PR11179
411cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieutemplate <short T> class Type1 {};
50d3317e0a2e0adb57ce8d075ebdcb41a3f939805Kaelyn Uhraintemplate <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}}
611cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu
711cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieutemplate <unsigned short T> class Type2 {};
80d3317e0a2e0adb57ce8d075ebdcb41a3f939805Kaelyn Uhraintemplate <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: expects an l-value for 1st argument}}
911cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu
1011cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieuvoid Function() {
1111cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu  Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}}
1211cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu  Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}}
1311cbe2a7fb565678fca456f6bc2d4648ced3adb3Richard Trieu}
14