xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
2f4a2713aSLionel Sambuc // rdar: //8620524
3f4a2713aSLionel Sambuc // PR7851
4f4a2713aSLionel Sambuc struct string {
5f4a2713aSLionel Sambuc   string (const string& );
6f4a2713aSLionel Sambuc   string ();
7f4a2713aSLionel Sambuc   ~string();
8f4a2713aSLionel Sambuc };
9f4a2713aSLionel Sambuc 
10f4a2713aSLionel Sambuc string operator + (char ch, const string&);
11f4a2713aSLionel Sambuc 
12f4a2713aSLionel Sambuc template <class T>
IntToString(T a)13f4a2713aSLionel Sambuc void IntToString(T a)
14f4a2713aSLionel Sambuc {
15f4a2713aSLionel Sambuc  string result;
16f4a2713aSLionel Sambuc  T digit;
17f4a2713aSLionel Sambuc  char((digit < 10 ? '0' : 'a') + digit) + result;
18f4a2713aSLionel Sambuc }
19f4a2713aSLionel Sambuc 
main()20f4a2713aSLionel Sambuc int main() {
21f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr void @_Z11IntToStringIcEvT_(
22f4a2713aSLionel Sambuc   IntToString('a');
23f4a2713aSLionel Sambuc }
24f4a2713aSLionel Sambuc 
25