cxx-constexpr.cpp 712 B

12345678910111213141516171819202122
  1. // RUN: %clang_cc1 -pedantic-errors -std=c++98 -emit-pch %s -o %t
  2. // RUN: %clang_cc1 -pedantic-errors -std=c++98 -include-pch %t -verify %s
  3. // RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t-cxx11
  4. // RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t-cxx11 -verify %s
  5. // RUN: %clang_cc1 -pedantic-errors -std=c++98 -emit-pch %s -o %t -fmodules
  6. // RUN: %clang_cc1 -pedantic-errors -std=c++98 -include-pch %t -verify %s -fmodules
  7. #ifndef HEADER_INCLUDED
  8. #define HEADER_INCLUDED
  9. extern const int a;
  10. const int b = a;
  11. #else
  12. const int a = 5;
  13. typedef int T[b]; // expected-error {{variable length array}} expected-error {{must be an integer constant expression}}
  14. typedef int T[5];
  15. #endif