According to the standard — an aggregate or union type that includes one of the aforementioned types among its elements or nonstatic data members (including, recursively, an element or non-static data member of a subaggregate or contained union), this is allowed:
struct foo {
float x;
};
void bar(foo*);
float values[9];
bar(reinterpret_cast<foo*>(&values));
However, I am not sure whether the following example also honors this rule:
struct foo {
float x;
float y;
float z;
};
void bar(foo*);
float values[9];
assert((sizeof(values) / sizeof(float)) % 3 == 0); // sanity check
bar(reinterpret_cast<foo*>(&values));