Bug 1417383

Summary: GCC7 & some of std:: function do not exist
Product: [Fedora] Fedora Reporter: Igor Gnatenko <ignatenko>
Component: gpgmeAssignee: Igor Gnatenko <ignatenko>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: davejohansen, fkluknav, ignatenko, jakub, jwakely, law, mpolacek, rdieter, tmraz
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-11 08:01:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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