https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121955
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2025-09-16 Status|UNCONFIRMED |WAITING --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Hi Benjamin! I tried to reproduce the error by filling in the blanks and couldn't. This compiles fine with and without -DWHICH #include <string> #include <tuple> std::string convert_to_utf8(std::string); namespace geo { enum class iplocation_mode { maxmind_1, other }; constexpr int city = 0; } namespace k { #ifdef WHICH constexpr auto geolocation_state = geo::iplocation_mode::maxmind_1; #else constexpr auto geolocation_state = geo::iplocation_mode::other; #endif } using std::string; template<typename T> void f(T p) { if constexpr (k::geolocation_state == geo::iplocation_mode::maxmind_1) string city = convert_to_utf8(std::get<geo::city>(p)); else string city = std::get<geo::city>(p); } int main() { std::tuple<std::string> t; f(t); } So we'll need more context.