blob: d751730d95f6ebdf872270fc9dcfb4bc3277c5bc [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
Richard Trieu11cbe2a2011-11-07 18:40:31 +000010void Function() {
11 Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}}
12 Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}}
Richard Trieu11cbe2a2011-11-07 18:40:31 +000013}