https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120775
--- Comment #25 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #24) > (In reply to Desmond Gold from comment #22) > > https://godbolt.org/z/qP8988P5b > > #include <meta> > > using namespace std::meta; > > template <typename> > void > foo () > { > constexpr int i = [: reflect_constant (5) :]; > constexpr info f = reflect_constant_array (std::vector { 1, 2, 3 }); > constexpr auto &arr = [: f :]; > constexpr auto &arr2 = [: reflect_constant_array (std::vector { 1, 2, 3 }) > :]; > } > > void > bar () > { > constexpr auto &arr = [: reflect_constant_array (std::vector { 1, 2, 3 }) > :]; > } > > int > main () > { > } > > splice calls cxx_constant_value when processing_template_decl, that looks > unexpected, I think normally we'd call fold_non_dependent_expr instead when > processing_template_decl. > Anyway, the ICE is because get_range_elts sees the processing_template_decl > specific trees like CAST_EXPR with std::vector <int> type instead of the > expected const std::vector <int> &&. Yes, but I got a crash on the gcc_checking_assert (TYPE_REF_P (type)); even when I do tsubst the arg, which is why I haven't fixed this yet :(
