18 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -verify=cxx11 -emit-llvm-only %s2// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify=cxx98 %s3// RUN: %clang_cc1 -std=c++11 -verify=cxx11 -emit-llvm-only %s -fexperimental-new-constant-interpreter4// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify=cxx98 %s -fexperimental-new-constant-interpreter5 6 7namespace std {8 template <class _E>9 class initializer_list {};10 // cxx11-error@-1 {{'std::initializer_list<int>' layout not recognized. Must be a non-polymorphic class type with no bases and two fields: a 'const E *' and either another 'const E *' or a 'std::size_t'}}11}12 13template<class E> int f(std::initializer_list<E> il);14 15 16int F = f({1, 2, 3});17// cxx98-error@-1 {{expected expression}}18