https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79156

            Bug ID: 79156
           Summary: incorrect c++ usage in gcc7 <memory> void function
                    returns a value
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mib.bugzilla at gmail dot com
  Target Milestone: ---

Hello, I work on the Intel c++ compiler and I found this problem when compiling
the gcc7 version of <memory> dated Jan 1, 2017. I believe the error message is
accurate and it could be fixed with a minor change.

In file included from
/xyz/gcc/7-20170101/rhel70/efi2/bin/../include/c++/7.0.0/bits/shared_ptr.h(52),
                 from
/xyz/gcc/7-20170101/rhel70/efi2/bin/../include/c++/7.0.0/memory(81),
                 from mem.cpp(1):
/xyz/gcc/7-20170101/rhel70/efi2/bin/../include/c++/7.0.0/bits/shared_ptr_base.h(1823):
error: return value type does not match the function type
        { return __p; }


The function being complained about looks like this:
 friend void
      __enable_shared_from_this_base(const __shared_count<_Lp>&,
                                     const __enable_shared_from_this* __p)
      { return __p; }

      mutable __weak_ptr<_Tp, _Lp>  _M_weak_this;
    };

Changing "friend void" to "friend auto" would be a simple fix.

Thanks and regards, Melanie Blower (melanie dot blower at intel dot com)

Reply via email to