summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp
blob: c0fa72ba42fbedb24f1be29f57676bc40e53266d (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify

void test_nonaggregate(int i) {
  auto lambda = [i]() -> void {}; // expected-note 3{{candidate constructor}}
  decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}}
  static_assert(!__is_literal(decltype(lambda)), "");

  auto lambda2 = []{}; // expected-note {{lambda}}
  decltype(lambda2) bar = {}; // expected-error{{call to implicitly-deleted default constructor}}
  static_assert(!__is_literal(decltype(lambda2)), "");
}
OpenPOWER on IntegriCloud