1*67e74705SXin Li // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 3*67e74705SXin Li // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 4*67e74705SXin Li // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 5*67e74705SXin Li 6*67e74705SXin Li namespace dr1346 { // dr1346: 3.5 7*67e74705SXin Li auto a(1); // expected-error 0-1{{extension}} 8*67e74705SXin Li auto b(1, 2); // expected-error {{multiple expressions}} expected-error 0-1{{extension}} 9*67e74705SXin Li #if __cplusplus >= 201103L 10*67e74705SXin Li auto c({}); // expected-error {{parenthesized initializer list}} 11*67e74705SXin Li auto d({1}); // expected-error {{parenthesized initializer list}} 12*67e74705SXin Li auto e({1, 2}); // expected-error {{parenthesized initializer list}} 13*67e74705SXin Li #endif f(Ts...ts)14*67e74705SXin Li template<typename...Ts> void f(Ts ...ts) { // expected-error 0-1{{extension}} 15*67e74705SXin Li auto x(ts...); // expected-error {{empty}} expected-error 0-1{{extension}} 16*67e74705SXin Li } 17*67e74705SXin Li template void f(); // expected-note {{instantiation}} 18*67e74705SXin Li 19*67e74705SXin Li #if __cplusplus >= 201103L init_capture()20*67e74705SXin Li void init_capture() { 21*67e74705SXin Li [a(1)] {} (); // expected-error 0-1{{extension}} 22*67e74705SXin Li [b(1, 2)] {} (); // expected-error {{multiple expressions}} expected-error 0-1{{extension}} 23*67e74705SXin Li #if __cplusplus >= 201103L 24*67e74705SXin Li [c({})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}} 25*67e74705SXin Li [d({1})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}} 26*67e74705SXin Li [e({1, 2})] {} (); // expected-error {{parenthesized initializer list}} expected-error 0-1{{extension}} 27*67e74705SXin Li #endif 28*67e74705SXin Li } 29*67e74705SXin Li #endif 30*67e74705SXin Li } 31*67e74705SXin Li 32*67e74705SXin Li namespace dr1359 { // dr1359: 3.5 33*67e74705SXin Li #if __cplusplus >= 201103L 34*67e74705SXin Li union A { constexpr A() = default; }; 35*67e74705SXin Li union B { constexpr B() = default; int a; }; // expected-error {{not constexpr}} expected-note 2{{candidate}} 36*67e74705SXin Li union C { constexpr C() = default; int a, b; }; // expected-error {{not constexpr}} expected-note 2{{candidate}} 37*67e74705SXin Li struct X { constexpr X() = default; union {}; }; 38*67e74705SXin Li struct Y { constexpr Y() = default; union { int a; }; }; // expected-error {{not constexpr}} expected-note 2{{candidate}} 39*67e74705SXin Li 40*67e74705SXin Li constexpr A a = A(); 41*67e74705SXin Li constexpr B b = B(); // expected-error {{no matching}} 42*67e74705SXin Li constexpr C c = C(); // expected-error {{no matching}} 43*67e74705SXin Li constexpr X x = X(); 44*67e74705SXin Li constexpr Y y = Y(); // expected-error {{no matching}} 45*67e74705SXin Li #endif 46*67e74705SXin Li } 47