Bug 1417383 - GCC7 & some of std:: function do not exist
Summary: GCC7 & some of std:: function do not exist
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gpgme
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Gnatenko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-28 15:08 UTC by Igor Gnatenko
Modified: 2017-02-11 08:01 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-11 08:01:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Igor Gnatenko 2017-01-28 15:08:03 UTC
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../../lang/cpp/src -I../../../src -I/usr/include/qt5/QtCore -I/usr/include/qt5    -I/usr/include/libassuan2 -DBUILDING_QGPGME   -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -c -o job.lo job.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lang/cpp/src -I../../../src -I/usr/include/qt5/QtCore -I/usr/include/qt5 -I/usr/include/libassuan2 -DBUILDING_QGPGME -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -c job.cpp  -fPIC -DPIC -o .libs/job.o
make[5]: Leaving directory '/builddir/build/BUILD/gpgme-1.8.0/lang/qt/src'
In file included from job.cpp:65:0:
threadedjobmixin.h:98:33: error: 'function' in namespace 'std' does not name a template type
     void setFunction(const std::function<T_result()> &function)
                                 ^~~~~~~~
...
threadedjobmixin.h:170:35: error: 'bind' is not a member of 'std'
         m_thread.setFunction(std::bind(func, this->context()));
                                   ^~~~

and so on. it doesn't specify -std=c++11, but I suppose it should not be required for gcc7 since its default std for c++ is c++14

Comment 1 Jonathan Wakely 2017-01-28 15:16:01 UTC
The obvious question is does the code #include <functional> ?

My first guess would be that it was previously relying on that header being implicitly included by some other header, and I reduced the interdependencies between headers.

The code needs to include what it uses.

Comment 2 Jonathan Wakely 2017-01-28 15:19:47 UTC
I don't see #include <functional> in gpgme-1.8.0/lang/qt/src/threadedjobmixin.h so this is almost certainly a bug in the package, not GCC.

GCC defines std::function and std::bind in the right place, as it always has.

Comment 3 Jonathan Wakely 2017-01-28 15:20:53 UTC
In fact I don't see #include <functional> ANYWHERE in the entire source tree for gpgme.

Comment 4 Igor Gnatenko 2017-01-28 15:23:08 UTC
(In reply to Jonathan Wakely from comment #2)
> I don't see #include <functional> in
> gpgme-1.8.0/lang/qt/src/threadedjobmixin.h so this is almost certainly a bug
> in the package, not GCC.
> 
> GCC defines std::function and std::bind in the right place, as it always has.
wondering how it worked before...

Comment 5 Jonathan Wakely 2017-01-28 15:24:53 UTC
For reference, the <future>, <mutex>, and <regex> headers used to include the whole of <functional> (thousands of lines), but now they don't. This is a Good Thing™.

I'll make a note of this in the GCC 7 "porting to" doc.

Comment 6 Igor Gnatenko 2017-01-28 15:25:51 UTC
(In reply to Jonathan Wakely from comment #5)
> For reference, the <future>, <mutex>, and <regex> headers used to include
> the whole of <functional> (thousands of lines), but now they don't. This is
> a Good Thing™.
> 
> I'll make a note of this in the GCC 7 "porting to" doc.
Thanks a lot!

Comment 7 Igor Gnatenko 2017-02-11 08:01:49 UTC
https://bugs.gnupg.org/gnupg/issue2955


Note You need to log in before you can comment on or make changes to this bug.