[Bug c++/71653] error when trying to compile a code with template friend function in a struct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653 Andrew Pinski changed: What|Removed |Added Keywords||rejects-valid --- Comment #4 from Andrew Pinski --- If I don't use an alias template in the original declaration of f it works: template using C = typename T::InnerType; template typename T::InnerType f(T &); class S { using InnerType = int; template friend C f(T &); }; int main() { S s; f(s); return 0; }
[Bug c++/71653] error when trying to compile a code with template friend function in a struct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed||2021-08-05 --- Comment #3 from Andrew Pinski --- Reduced testcase without includes: template using C = typename T::InnerType; template C f(T &); class S { using InnerType = int; template friend C f(T &); }; int main() { S s; f(s); return 0; }
[Bug c++/71653] error when trying to compile a code with template friend function in a struct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653 --- Comment #2 from Raphael Gozzo --- This error happens in the 6.1 version too (tested here http://gcc.godbolt.org)
[Bug c++/71653] error when trying to compile a code with template friend function in a struct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653 --- Comment #1 from Raphael Gozzo --- Created attachment 38765 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38765=edit source file