xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/drs/dr13xx.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc namespace dr1346 { // dr1346: 3.5
7*0a6a1f1dSLionel Sambuc   auto a(1); // expected-error 0-1{{extension}}
8*0a6a1f1dSLionel Sambuc   auto b(1, 2); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}
9*0a6a1f1dSLionel Sambuc #if __cplusplus >= 201103L
10*0a6a1f1dSLionel Sambuc   auto c({}); // expected-error {{parenthesized initializer list}} expected-error {{cannot deduce}}
11*0a6a1f1dSLionel Sambuc   auto d({1}); // expected-error {{parenthesized initializer list}} expected-error {{<initializer_list>}}
12*0a6a1f1dSLionel Sambuc   auto e({1, 2}); // expected-error {{parenthesized initializer list}} expected-error {{<initializer_list>}}
13*0a6a1f1dSLionel Sambuc #endif
f(Ts...ts)14*0a6a1f1dSLionel Sambuc   template<typename...Ts> void f(Ts ...ts) { // expected-error 0-1{{extension}}
15*0a6a1f1dSLionel Sambuc     auto x(ts...); // expected-error {{empty}} expected-error 0-1{{extension}}
16*0a6a1f1dSLionel Sambuc   }
17*0a6a1f1dSLionel Sambuc   template void f(); // expected-note {{instantiation}}
18*0a6a1f1dSLionel Sambuc 
19*0a6a1f1dSLionel Sambuc #if __cplusplus >= 201103L
init_capture()20*0a6a1f1dSLionel Sambuc   void init_capture() {
21*0a6a1f1dSLionel Sambuc     [a(1)] {} (); // expected-error 0-1{{extension}}
22*0a6a1f1dSLionel Sambuc     [b(1, 2)] {} (); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}
23*0a6a1f1dSLionel Sambuc #if __cplusplus >= 201103L
24*0a6a1f1dSLionel Sambuc     [c({})] {} (); // expected-error {{parenthesized initializer list}} expected-error {{cannot deduce}} expected-error 0-1{{extension}}
25*0a6a1f1dSLionel Sambuc     [d({1})] {} (); // expected-error {{parenthesized initializer list}} expected-error {{<initializer_list>}} expected-error 0-1{{extension}}
26*0a6a1f1dSLionel Sambuc     [e({1, 2})] {} (); // expected-error {{parenthesized initializer list}} expected-error {{<initializer_list>}} expected-error 0-1{{extension}}
27*0a6a1f1dSLionel Sambuc #endif
28*0a6a1f1dSLionel Sambuc   }
29*0a6a1f1dSLionel Sambuc #endif
30*0a6a1f1dSLionel Sambuc }
31