NVHPC: can't build CMake from source >= 3.25.0

Using a container started from nvcr.io/nvidia/nvhpc:22.11-devel-cuda_multi-ubuntu22.04, I can reproduce the NVHPC compiler crash in a small test case like this:

$ cat example.cxx
struct A { ~A(); };
template<typename T> struct X { X(int, T, A = A()); };
template<typename T> struct Y : public T { using T::T; };
struct S {
  X<double> x{1, 1.0};
  Y<X<double>> y{1, 1.0};
};

$ nvc++ --version
nvc++ 22.11-0 64-bit target on x86-64 Linux ...

$ nvc++ -c example.cxx
Internal error: read_memory_region: not all expected entries were read

nvc++-Fatal-/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/compilers/bin/tools/cpp2 TERMINATED by signal 6