https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104641

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
One workaround is to use a helper member function (defined alongside the nested
class template) that performs the CTAD, something like:

#include <utility>

template<class T>
struct A {
  template<class U> struct B { B(U); };

  template<typename... Ts>
  static auto make_B(Ts&&... args) {
    return B(std::forward<Ts>(args)...);
  }
};

template<class T>
void f() {
  auto x = A<T>::make_B(0);
}

template void f<int>();

https://godbolt.org/z/vqjff9nbs

Reply via email to