summaryrefslogtreecommitdiff
path: root/clang/test/PCH/cxx-constexpr.cpp
blob: 8fe48f7377ec1403effe466a9c2d7384ad324f94 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 -pedantic-errors -std=c++98 -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic-errors -std=c++98 -include-pch %t -verify %s

// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t-cxx11
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t-cxx11 -verify %s

#ifndef HEADER_INCLUDED

#define HEADER_INCLUDED
extern const int a;
const int b = a;

#else

const int a = 5;
typedef int T[b]; // expected-error {{variable length array}} expected-error {{must be an integer constant expression}}
typedef int T[5];

#endif