http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61113

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to jpakkane from comment #0)
> That is, both the private and public methods are exported in the symbol
> table. The latter is wasteful because private methods can only be called
> from within the class and those methods are always in the same .so (or maybe
> there are pathological cases why someone might want to split class
> implementation over multiple .so files, but it seems unlikely).

What if you want to call a private member function from an inline member
function?

i.e. I think the suggestion fails for this case:

class __attribute__ ((visibility("default"))) Thing final {
public:
  void publicFunc() { privateFunc(); }
private:
  void __attribute__ ((visibility("hidden"))) privateFunc();
};

Reply via email to