blob: c0fa72ba42fbedb24f1be29f57676bc40e53266d [file] [log] [blame]
Douglas Gregor291af2b2012-02-09 08:15:36 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
2
3void test_nonaggregate(int i) {
Douglas Gregor656bc622012-02-09 08:26:42 +00004 auto lambda = [i]() -> void {}; // expected-note 3{{candidate constructor}}
Douglas Gregor291af2b2012-02-09 08:15:36 +00005 decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}}
Richard Smith640775b2014-10-07 18:01:33 +00006 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 Gregor291af2b2012-02-09 08:15:36 +000011}