public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/71653] error when trying to compile a code with template friend function in a struct
[not found] <bug-71653-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-05 8:47 ` pinskia at gcc dot gnu.org
2021-08-05 8:51 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 8:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2021-08-05
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase without includes:
template <typename T> using C = typename T::InnerType;
template <typename T> C<T> f(T &);
class S {
using InnerType = int;
template <typename T> friend C<T> f(T &);
};
int main()
{
S s;
f(s);
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/71653] error when trying to compile a code with template friend function in a struct
[not found] <bug-71653-4@http.gcc.gnu.org/bugzilla/>
2021-08-05 8:47 ` [Bug c++/71653] error when trying to compile a code with template friend function in a struct pinskia at gcc dot gnu.org
@ 2021-08-05 8:51 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 8:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71653
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
If I don't use an alias template in the original declaration of f it works:
template <typename T> using C = typename T::InnerType;
template <typename T> typename T::InnerType f(T &);
class S {
using InnerType = int;
template <typename T> friend C<T> f(T &);
};
int main()
{
S s;
f(s);
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-05 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-71653-4@http.gcc.gnu.org/bugzilla/>
2021-08-05 8:47 ` [Bug c++/71653] error when trying to compile a code with template friend function in a struct pinskia at gcc dot gnu.org
2021-08-05 8:51 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).