https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90925
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2019-06-19 00:00:00 |2020-3-12 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to zhonghao from comment #0) > My gcc is 10.0.0, and my code is: > > class a { > private: template <typename b> a &operator<<(b); > }; > a c(); > template <typename> a fn2() { > int d; > return c() << d; > } > > gcc accepts the code, but clang rejects it: > > error: 'operator<<' is a private member of 'a' > return c() << d; > ~~~ ^ ~ > note: implicitly declared private here > template <typename b> a &operator<<(b); > ^ > 1 error generated. This is probably another dup of PR 41437