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