From dba351df64e1a3b03506ae611e0a009baed0b8df Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 2 Nov 2010 21:05:53 +0000 Subject: Fixes an assertion violation when bind to temporary expression is a dependent expression. // rdar: // 8620524 and PR7851 llvm-svn: 118066 --- .../template-dependent-bind-temporary.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp (limited to 'clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp') diff --git a/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp b/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp new file mode 100644 index 00000000000..cc1ce866fe2 --- /dev/null +++ b/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// rdar: //8620524 +// PR7851 +struct string { + string (const string& ); + string (); + ~string(); +}; + +string operator + (char ch, const string&); + +template +void IntToString(T a) +{ + string result; + T digit; + char((digit < 10 ? '0' : 'a') + digit) + result; +} + +int main() { +// CHECK: define linkonce_odr void @_Z11IntToStringIcEvT_( + IntToString('a'); +} + -- cgit v1.2.3