[Bug c++/126922] New: internal compiler error when initializing a struct of std::meta::info

"stephane.chea at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126922

            Bug ID: 126922
           Summary: internal compiler error when initializing a struct of
                    std::meta::info
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stephane.chea at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/71bq7cMzW

When using designated initializers with a struct with 2 or more
std::meta::info, if you initialize a member that appear after an omitted
member, this result in a internal compiler error.

This only happens when both members are std::meta::info.

```
#include <meta>

struct TestStruct {
    std::meta::info first;
    std::meta::info second;
};

template <TestStruct>
consteval void test() {}

int main() {
    test<TestStruct{.second = {}}>(); // fails, works if we swap first and
second in the struct
    // test<TestStruct{.first = {}}>(); // works
    // test<TestStruct{}>(); // works
    // test<TestStruct{.first = {}, .second = {}}>(); // works
}

```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.