A failed template deduction in template member of a template triggers an ICE with -std=c++17 due to what seems like a missing handling of invalid input. Replacing the gcc_unreachable() call that causes the ICE with a return statement indicating the deduction failure eliminates the ICE and restores sane diagnostics. Martin