Clang Project

clang_source_code/test/SemaCXX/PR20334-std_initializer_list_diagnosis_assertion.cpp
1// RUN: %clang_cc1 -std=c++11 -verify -emit-llvm-only %s
2// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s -DCPP98
3
4namespace std {
5  template <class _E>
6  class initializer_list
7  {};
8}
9
10template<class E> int f(std::initializer_list<E> il);
11
12
13int F = f({1, 2, 3});
14#ifdef CPP98
15//expected-error@-2{{expected expression}}
16#else
17//expected-error@-4{{cannot compile}}
18#endif
19
20
21