• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4 // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5 
6 namespace dr1346 { // dr1346: 3.5
7   auto a(1); // expected-error 0-1{{extension}}
8   auto b(1, 2); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}
9 #if __cplusplus >= 201103L
10   auto c({}); // expected-error {{parenthesized initializer list}}
11   auto d({1}); // expected-error {{parenthesized initializer list}}
12   auto e({1, 2}); // expected-error {{parenthesized initializer list}}
13 #endif
f(Ts...ts)14   template<typename...Ts> void f(Ts ...ts) { // expected-error 0-1{{extension}}
15     auto x(ts...); // expected-error {{empty}} expected-error 0-1{{extension}}
16   }
17   template void f(); // expected-note {{instantiation}}
18 
19 #if __cplusplus >= 201103L
init_capture()20   void init_capture() {
21     [a(1)] {} (); // expected-error 0-1{{extension}}
22     [b(1, 2)] {} (); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}
23 #if __cplusplus >= 201103L
24     [c({})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}}
25     [d({1})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}}
26     [e({1, 2})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}}
27 #endif
28   }
29 #endif
30 }
31