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

"jakub at gcc dot gnu.org 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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase without headers:
struct A {
  decltype (^^::) a, b;
};

template <A>
consteval void foo () {}

int
main ()
{
  foo <A { .b = {}}> ();
}

We ICE in
3890                                    if (abi_check (21))
3891                                      write_expression (build_zero_cst
3892                                                        (TREE_TYPE
(field)));
because build_zero_cst, which is defined in generic part of the compiler,
doesn't properly handle META_TYPE (which is FE specific).
Now, we could call instead of build_zero_cst (type) build_zero_init (type,
NULL_TREE, false), or do so only for scalar types and keep using build_zero_cst
otherwise, ...
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.