1 // RUN: %clang_cc1 -std=c++1z %s -verify
2 // RUN: %clang_cc1 -std=c++14 %s -verify
3 // RUN: %clang_cc1 -std=c++11 %s -verify
4
5
6 auto XL0 = [] constexpr { }; //expected-error{{requires '()'}} expected-error{{expected body}}
7 auto XL1 = [] () mutable
8 mutable //expected-error{{cannot appear multiple times}}
__anon71e8fdf30102() 9 mutable { }; //expected-error{{cannot appear multiple times}}
10
11 #if __cplusplus > 201402L
__anon71e8fdf30202() 12 auto XL2 = [] () constexpr mutable constexpr { }; //expected-error{{cannot appear multiple times}}
__anon71e8fdf30302() 13 auto L = []() mutable constexpr { };
__anon71e8fdf30402() 14 auto L2 = []() constexpr { };
__anon71e8fdf30502() 15 auto L4 = []() constexpr mutable { };
16 auto XL16 = [] () constexpr
17 mutable
18 constexpr //expected-error{{cannot appear multiple times}}
19 mutable //expected-error{{cannot appear multiple times}}
20 mutable //expected-error{{cannot appear multiple times}}
21 constexpr //expected-error{{cannot appear multiple times}}
22 constexpr //expected-error{{cannot appear multiple times}}
__anon71e8fdf30602() 23 { };
24
25 #else
__anon71e8fdf30702() 26 auto L = []() mutable constexpr {return 0; }; //expected-warning{{is a C++1z extension}}
__anon71e8fdf30802() 27 auto L2 = []() constexpr { return 0;};//expected-warning{{is a C++1z extension}}
__anon71e8fdf30902() 28 auto L4 = []() constexpr mutable { return 0; }; //expected-warning{{is a C++1z extension}}
29 #endif
30
31
32