p3.cpp 497 B

1234567891011
  1. // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
  2. void test_nonaggregate(int i) {
  3. auto lambda = [i]() -> void {}; // expected-note 2{{candidate constructor}}
  4. decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}}
  5. static_assert(!__is_literal(decltype(lambda)), "");
  6. auto lambda2 = []{}; // expected-note 2{{candidate constructor}}
  7. decltype(lambda2) bar = {}; // expected-error{{no matching constructor}}
  8. static_assert(!__is_literal(decltype(lambda2)), "");
  9. }