Xcode 5.0.2: C++11's std::function should be expanded like blocks are

Originator:kusterer
Number:rdar://15737608 Date Originated:02-Jan-2014 01:37 PM
Status:Duplicate/13409273 Resolved:07-Jan-2014 19:02
Product:Developer Tools Product Version:Xcode 5.0.2 (5A3005)
Classification:Serious Bug Reproducible:Not Applicable
 
Summary:
When auto-completion has generated a capsule for a block parameter on a function or method call, double-clicking it expands it into an actual instantiation of a block. This feature is missing for C++11 Lambdas.

Steps to Reproduce:
• Type "[NSURLConnection sendAsync" in an ObjC source file, then press ESC and accept the suggested completion by pressing the tab key.
• Double-click the third blue parameter placeholder capsule (the block parameter that starts with ^). It expands into an actual block instantiation with a "code" placeholder between the curly brackets.
• Now create a C++ file and add the CTimer.h and CTimer.mm files from https://github.com/uliwitness/Stacksmith/commit/23fa867f9b871b3093e78b55b15cf4cbe30860fa#diff-70a5864bdbd4d2c3b01c8fc8daf4fc3d to the project.
• Include CTimer.h in your C++ file and write "CTimer timer; timer.SetHa" (without the quotes) in a function in there.
• Press ESC to auto-complete, and accept the completion to SetHandler.
• Double-click the blue parameter placeholder capsule to expand it (the one that starts with "std::function")

Expected Results:
• The capsule should expand into an instantiation of a C++11 Lambda, like []( CTimer* ) { <#code#> }

Actual Results:
• The capsule is simply removed and the lambda type turned into text, "std::function<void (CTimer *)> timerHandler".

Notes:
Make sure your C++ language dialect is set to C++11, earlier versions of C++ don't support Lambdas.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!