Douglas Gregor | 291af2b | 2012-02-09 08:15:36 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify |
| 2 | |
| 3 | void test_nonaggregate(int i) { |
Douglas Gregor | 656bc62 | 2012-02-09 08:26:42 +0000 | [diff] [blame] | 4 | auto lambda = [i]() -> void {}; // expected-note 3{{candidate constructor}} |
Douglas Gregor | 291af2b | 2012-02-09 08:15:36 +0000 | [diff] [blame] | 5 | decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}} |
Richard Smith | 640775b | 2014-10-07 18:01:33 +0000 | [diff] [blame] | 6 | static_assert(!__is_literal(decltype(lambda)), ""); |
| 7 | |
| 8 | auto lambda2 = []{}; // expected-note {{lambda}} |
| 9 | decltype(lambda2) bar = {}; // expected-error{{call to implicitly-deleted default constructor}} |
| 10 | static_assert(!__is_literal(decltype(lambda2)), ""); |
Douglas Gregor | 291af2b | 2012-02-09 08:15:36 +0000 | [diff] [blame] | 11 | } |