[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaObjCXX / cxx1y-lambda.mm
blob589e66db51ac8079388f14084780f1a83104bda1
1 // RUN: %clang_cc1 -std=c++1y -Wno-unused-value -fsyntax-only -verify -fobjc-arc %s
3 // expected-no-diagnostics
4 __attribute__((objc_root_class))
5 @interface NSString
6 @end
8 void testResultTypeDeduction(int i) {
9   auto x = [i] {
10     switch (i) {
11     case 0:
12       return @"foo";
14     default:
15       return @"bar";
16     }
17   };