From 3940e3b9c7cc89284117112e07ad1c925dcd0ab4 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 8 Nov 2013 02:04:24 +0000 Subject: Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained reference. Under ARC++, a reference to a const Objective-C pointer is implicitly treated as __unsafe_unretained, and can be initialized with (e.g.) a __strong lvalue. Make sure this behavior does not break template argument deduction and (related) that partial ordering still prefers a 'T* const&' template over a 'T const&' template when this case kicks in. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194239 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaObjCXX/arc-templates.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/SemaObjCXX/arc-templates.mm') diff --git a/test/SemaObjCXX/arc-templates.mm b/test/SemaObjCXX/arc-templates.mm index ef68b94e72..b3519b9573 100644 --- a/test/SemaObjCXX/arc-templates.mm +++ b/test/SemaObjCXX/arc-templates.mm @@ -292,3 +292,13 @@ namespace rdar12367446 { A value; } } + +namespace rdar14467941 { + template int &takePtr(const T &); + template float &takePtr(T * const &); + + void testTakePtr(A *a) { + float &fr1 = takePtr(a); + float &fr2 = takePtr(a); + } +} -- cgit v1.2.3