[Bug c++/115803] New: ICE: tree check: expected class 'type', have 'constant' (integer_cst) in cp_type_quals, at cp/typeck.cc:11646
hewillk at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Jul 6 05:31:34 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115803
Bug ID: 115803
Summary: ICE: tree check: expected class 'type', have
'constant' (integer_cst) in cp_type_quals, at
cp/typeck.cc:11646
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
#include <tuple>
#include <variant>
auto get_n = []<class Tuple>(Tuple&& t, std::size_t index) {
using variant_type = decltype(std::apply([]<class... Ts>(Ts...){
return std::variant<Ts...>{};
}, t));
return [&]<std::size_t... Is>(std::index_sequence<Is...>) {
std::array<variant_type(*)(Tuple&&), 2> fs = {
+[](Tuple&& tup){ return variant_type{std::get<Is>(tup)};}... };
return fs[index](t);
}(std::make_index_sequence<2>());
};
int main() {
std::visit( [](auto&& v) { }, get_n(std::tuple{1,2.}, 1));
}
https://godbolt.org/z/xYvoqfPeo
More information about the Gcc-bugs
mailing list