https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

            Bug ID: 95319
           Summary: Regression from gcc9.3 when inserting into a vector
                    with an initializer list. Error: a GNU-style
                    designated initializer for class
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haldormnk at hotmail dot com
  Target Milestone: ---

https://godbolt.org/z/zZtP9z

#include <iostream>
#include <array>
#include <vector>
int main() {
    using Array = std::array<double, 3>;
    using ArrayVector = std::vector<Array>;
    auto vector = ArrayVector();
    vector.emplace_back(Array({1,1,1})); // works
    vector.insert(std::end(vector),{{2,2,2}}); // fails in gcc10.1
}

With gcc9.3 it compiles, but with gcc10.1, there is an error in the last line:

error: '[0] =' used in a GNU-style designated initializer for class
'std::array<double, 3>'

Reply via email to