mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 19:16:05 +00:00

... tried their initializer already. In that case, diagnose the non-const initializer instead of the reference to a non-constexpr variable later. This is used in a lot of openmp tests.
14 lines
415 B
C++
14 lines
415 B
C++
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -fopenmp %s
|
|
// RUN: %clang_cc1 -verify=ref,both -fopenmp %s
|
|
|
|
int test1() {
|
|
int i;
|
|
int &j = i; // both-note {{declared here}}
|
|
float *f;
|
|
// both-note@+2 {{initializer of 'j' is not a constant expression}}
|
|
// both-error@+1 {{integral constant expression}}
|
|
#pragma omp for simd aligned(f:j)
|
|
for (int i = 0; i < 10; ++i);
|
|
}
|
|
|