blob: 39c7090cae52d3810462a7f5ed924c813c8d72cd [file] [log] [blame]
Richard Trieu11cbe2a2011-11-07 18:40:31 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
2
3// PR11179
4template <short T> class Type1 {};
5template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: no known conversion from 'Type1<-42>' to 'Type1<-42> &' for 1st argument;}}
6
7template <unsigned short T> class Type2 {};
8template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: no known conversion from 'Type2<42>' to 'Type2<42> &' for 1st argument;}}
9
10template <__int128_t T> class Type3 {};
11template <__int128_t T> void Function3(Type3<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: no known conversion from 'Type3<-42>' to 'Type3<-42i128> &' for 1st argument;}}
12
13template <__uint128_t T> class Type4 {};
14template <__uint128_t T> void Function4(Type4<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: no known conversion from 'Type4<42>' to 'Type4<42Ui128> &' for 1st argument;}}
15
16void Function() {
17 Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}}
18 Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}}
19 Function3(Type3<-42>()); // expected-error{{no matching function for call to 'Function3'}}
20 Function4(Type4<42>()); // expected-error{{no matching function for call to 'Function4'}}
21}