title: Return type in demangled member function name
body: <p>What is the reason for the g++ <code>abi::__cxa_demangle</code> function to not return the return value for member functions?</p>
  
  <p>Here's a working example of this behavior</p>
  
  <pre><code>#include &lt;execinfo.h&gt;
  #include &lt;cxxabi.h&gt;
  #include &lt;iostream&gt;
  
  struct Foo {
      void operator()() const
      {
          constexpr int buf_size = 100;
          static void *buffer[buf_size];
          int nptrs = backtrace(buffer, buf_size);
          char **strings = backtrace_symbols(buffer, nptrs);
          for(int i = 0; i &lt; nptrs; ++i) {
  
              auto str = std::string(strings[i]);
              auto first = str.find_last_of('(') + 1;
              auto last = str.find_last_of(')');
              auto mas = str.find_last_of('+');
  
              int status;
              char* result = abi::__cxa_demangle(str.substr(first, mas-first).c_str(), nullptr, nullptr, &amp;status);
              if (status == 0) std::cout &lt;&lt; result &lt;&lt; std::endl;
          }
      }
  };
  
  int main () {
      Foo f;
      f();
  }
  </code></pre>
  
  <p>and after compiling with
  <code>g++ foo.cpp -std=c++11 -rdynamic</code>
  the output is
  <code>Foo::operator()() const</code></p>
  
  <p>Is there a way to get a consistent behavior, this is, getting also the return value for the member functions?</p>