public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95319] New: Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class
@ 2020-05-25 16:35 haldormnk at hotmail dot com
  2020-05-26  7:19 ` [Bug c++/95319] [10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: haldormnk at hotmail dot com @ 2020-05-25 16:35 UTC (permalink / raw)
  To: gcc-bugs

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>'

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-27 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 16:35 [Bug c++/95319] New: Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class haldormnk at hotmail dot com
2020-05-26  7:19 ` [Bug c++/95319] [10/11 Regression] " rguenth at gcc dot gnu.org
2020-05-26  8:25 ` marxin at gcc dot gnu.org
2020-05-26 21:53 ` jason at gcc dot gnu.org
2020-05-27 18:20 ` cvs-commit at gcc dot gnu.org
2020-05-27 18:24 ` cvs-commit at gcc dot gnu.org
2020-05-27 18:27 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).