Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/pr68180.C

raw
1 // PR c++/68180
2 // { dg-do compile { target c++14 } }
3 // { dg-additional-options "-Wno-psabi" }
4
5 typedef float __attribute__( ( vector_size( 16 ) ) ) float32x4_t;
6 constexpr float32x4_t fill(float x) {
7 float32x4_t v{0};
8 constexpr auto vs = sizeof(v)/sizeof(v[0]);
9 for (auto i=0U; i<vs; ++i) v[i]=i; // { dg-error "not a constant" }
10 return v+x;
11 }
12
13 float32x4_t foo(float32x4_t x) {
14 constexpr float32x4_t v = fill(1.f); // { dg-message "in .constexpr. expansion of " }
15 return x+v;
16 }