[Bug c++/53094] constexpr vector subscripting

vincenzo.innocente at cern dot ch gcc-bugzilla@gcc.gnu.org
Mon Dec 3 14:30:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53094

--- Comment #7 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-12-03 14:29:54 UTC ---
a bit of cross posting with PR55573] sorry

this

typedef float __attribute__( ( vector_size( 4*sizeof(float) ) ) ) V4;
constexpr V4 build(float x,float y, float z) { return (V4){x,y,z,0};}
constexpr V4 x = build(1,0,0);

produces

c++ -std=c++11 -Ofast -c ceVec.cc 
ceVec.cc:3:29: error: ‘(const V4)V4{1.0e+0f, 0.0f, 0.0f, 0.0f}’ is not a
constant expression
 constexpr V4 x = build(1,0,0);



More information about the Gcc-bugs mailing list