the following code rejected msvc 15.4.0 preview 1 (vs 2017), accepted gcc 7.1.0.
struct b { template<typename... ts> constexpr b(ts... data) : data_{data...} {} int data_[5]; }; struct d : b { using b::b; }; constexpr /*b*/ d g() { return /*b*/ d(4, 5, 6); } int main() { constexpr auto z = g(); }
the error is: error c3615 constexpr function 'g' cannot result in constant expression. if construct , return b
, fine.
is bug in msvc compiler?
Comments
Post a Comment