1 // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4 // RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5
6 #if __cplusplus < 201103L
7 // expected-no-diagnostics
8 #endif
9
dr1891()10 void dr1891() { // dr1891: 3.6
11 #if __cplusplus >= 201103L
12 int n;
13 auto a = []{}; // expected-note 2{{candidate}}
14 auto b = [=]{ return n; }; // expected-note 2{{candidate}}
15 typedef decltype(a) A;
16 typedef decltype(b) B;
17
18 static_assert(!__has_trivial_constructor(A), "");
19 static_assert(!__has_trivial_constructor(B), "");
20
21 A x; // expected-error {{no matching constructor}}
22 B y; // expected-error {{no matching constructor}}
23 #endif
24 }
25