clang/test/SemaObjCXX/cxx1y-lambda.mm
raw| 1 | // RUN: %clang_cc1 -std=c++1y -Wno-unused-value -fsyntax-only -verify -fobjc-arc %s |
| 2 | |
| 3 | // expected-no-diagnostics |
| 4 | __attribute__((objc_root_class)) |
| 5 | @interface NSString |
| 6 | @end |
| 7 | |
| 8 | void testResultTypeDeduction(int i) { |
| 9 | auto x = [i] { |
| 10 | switch (i) { |
| 11 | case 0: |
| 12 | return @"foo"; |
| 13 | |
| 14 | default: |
| 15 | return @"bar"; |
| 16 | } |
| 17 | }; |
| 18 | } |