PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C

#
C | 10 lines | 6 code | 3 blank | 1 comment | 3 complexity | 4f8d1cfbe2853b13de574f37e3c6fe91 MD5 | raw file
Possible License(s): LGPL-2.0, GPL-2.0, LGPL-2.1, AGPL-1.0, GPL-3.0, BSD-3-Clause
  1. // { dg-options -std=c++0x }
  2. #include <initializer_list>
  3. constexpr auto list = { 1, 2, 3, 4 };
  4. #define SA(X) static_assert(X, #X)
  5. SA(list.size() == 4);
  6. SA(list.begin()[2] == 3);
  7. SA(list.end()[-1] == 4);