xref: /aosp_15_r20/external/clang/test/PCH/cxx-constexpr.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++98 -emit-pch %s -o %t
2*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++98 -include-pch %t -verify %s
3*67e74705SXin Li 
4*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t-cxx11
5*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t-cxx11 -verify %s
6*67e74705SXin Li 
7*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++98 -emit-pch %s -o %t -fmodules
8*67e74705SXin Li // RUN: %clang_cc1 -pedantic-errors -std=c++98 -include-pch %t -verify %s -fmodules
9*67e74705SXin Li 
10*67e74705SXin Li #ifndef HEADER_INCLUDED
11*67e74705SXin Li 
12*67e74705SXin Li #define HEADER_INCLUDED
13*67e74705SXin Li extern const int a;
14*67e74705SXin Li const int b = a;
15*67e74705SXin Li 
16*67e74705SXin Li #else
17*67e74705SXin Li 
18*67e74705SXin Li const int a = 5;
19*67e74705SXin Li typedef int T[b]; // expected-error {{variable length array}} expected-error {{must be an integer constant expression}}
20*67e74705SXin Li typedef int T[5];
21*67e74705SXin Li 
22*67e74705SXin Li #endif
23