teak-llvm/clang/test/SemaObjCXX/cxx1y-lambda.mm
Douglas Gregor a602a153de Perform Objective-C lifetime adjustments before comparing deduced lambda result types.
Objective-C ARC lifetime qualifiers are dropped when canonicalizing
function types. Perform the same adjustment before comparing the
deduced result types of lambdas. Fixes rdar://problem/22344904.

llvm-svn: 249065
2015-10-01 20:20:47 +00:00

20 lines
351 B
Plaintext

// RUN: %clang_cc1 -std=c++1y -Wno-unused-value -fsyntax-only -verify -fobjc-arc %s
// expected-no-diagnostics
__attribute__((objc_root_class))
@interface NSString
@end
// rdar://problem/22344904
void testResultTypeDeduction(int i) {
auto x = [i] {
switch (i) {
case 0:
return @"foo";
default:
return @"bar";
}
};
}