https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94799
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu.org
--- Comment #9 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Hi Marek,
your fix unfortunately breaks the following valid code (reduced from pybind11):
=======================================================
template <typename> struct A
{
typedef int type;
operator int();
};
template <typename T> using B = A<T>;
template <typename T> typename B<T>::type foo(B<T> b)
{
return b.operator typename B<T>::type();
}
void bar()
{
foo(A<int>());
}
=======================================================
bug.cc: In instantiation of 'typename B<T>::type foo(B<T>) [with T = int;
typename B<T>::type = int; B<T> = A<int>; B<T> = A<int>]':
bug.cc:16:15: required from here
bug.cc:11:36: error: no type named 'B' in 'struct A<int>'
11 | return b.operator typename B<T>::type();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~