// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11 // PR11179 template class Type1 {}; template void Function1(Type1& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}} template class Type2 {}; template void Function2(Type2& x) {} // expected-note{{candidate function [with T = 42] not viable: expects an l-value for 1st argument}} enum class boolTy : bool { b = 0, }; template struct Type3Helper; template <> struct Type3Helper { typedef boolTy Ty; }; template ::Ty U> struct Type3 {}; // PR14386 enum class charTy : char { c = 0, }; template struct Type4Helper; template <> struct Type4Helper { typedef charTy Ty; }; template ::Ty U> struct Type4 {}; enum class scharTy : signed char { c = 0, }; template struct Type5Helper; template <> struct Type5Helper { typedef scharTy Ty; }; template ::Ty U> struct Type5 {}; enum class ucharTy : unsigned char { c = 0, }; template struct Type6Helper; template <> struct Type6Helper { typedef ucharTy Ty; }; template ::Ty U> struct Type6 {}; enum class wcharTy : wchar_t { c = 0, }; template struct Type7Helper; template <> struct Type7Helper { typedef wcharTy Ty; }; template ::Ty U> struct Type7 {}; enum class char16Ty : char16_t { c = 0, }; template struct Type8Helper; template <> struct Type8Helper { typedef char16Ty Ty; }; template ::Ty U> struct Type8 {}; enum class char32Ty : char16_t { c = 0, }; template struct Type9Helper; template <> struct Type9Helper { typedef char32Ty Ty; }; template ::Ty U> struct Type9 {}; void Function() { Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}} Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}} struct Type3 t3; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type3Helper<(boolTy)false>::Ty' (aka 'boolTy')}} struct Type4 t4; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type4Helper<(charTy)'\x00'>::Ty' (aka 'charTy')}} struct Type5 t5; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type5Helper<(scharTy)'\x00'>::Ty' (aka 'scharTy')}} struct Type6 t6; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type6Helper<(ucharTy)'\x00'>::Ty' (aka 'ucharTy')}} struct Type7 t7; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type7Helper<(wcharTy)L'\x00'>::Ty' (aka 'wcharTy')}} struct Type8 t8; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type8Helper<(char16Ty)u'\x00'>::Ty' (aka 'char16Ty')}} struct Type9 t9; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type9Helper<(char32Ty)u'\x00'>::Ty' (aka 'char32Ty')}} }