diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-02 21:05:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-02 21:05:53 +0000 |
commit | b8e39236f05b2f71fb2632673948499fd54e2a34 (patch) | |
tree | e3fc3e9018bb955dbb35eaa5881e490bec76b20c /test/CodeGenCXX/template-dependent-bind-temporary.cpp | |
parent | 112c967bd5c862a0f5d7913aa06700c048807db8 (diff) |
Fixes an assertion violation when bind to temporary
expression is a dependent expression.
// rdar: // 8620524 and PR7851
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/template-dependent-bind-temporary.cpp')
-rw-r--r-- | test/CodeGenCXX/template-dependent-bind-temporary.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGenCXX/template-dependent-bind-temporary.cpp b/test/CodeGenCXX/template-dependent-bind-temporary.cpp new file mode 100644 index 0000000000..cc1ce866fe --- /dev/null +++ b/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 <class T> +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'); +} + |