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