Latte : make_unique for gcc <=4.8

Adriaan de Groot groot at
Thu Nov 9 11:22:56 GMT 2017

On Thursday, 9 November 2017 09:58:26 CET Tomaz Canabrava wrote:
> On Sun, Nov 5, 2017 at 4:12 PM, Michail Vourlakos <mvourlakos at>
> > during the review phase in Latte we removed the following code in case it
> > would conflict in some cases:
> > 
> > #if __GLIBCXX__ <= 20150623
> > namespace std {
> > template<class T, class... Args>
> > unique_ptr<T> make_unique(Args &&... args)
> > #endif
> > 
> > 
> > this was needed for gcc versions that even though they are C++14
> > compatible they dont offer make_unique function. By removing that code we
> > broke compatibility with openSUSE Leap that uses gcc 4.8.5 ... so in order
> > to build latte packages a made a patch to readd that code.

The problem was at least partly (IIRC) that the check doesn't detect Clang, 
and then defines a duplicate (language-lawyering says it's undefined behavior). 
The problem isn't so much with gcc itself, as with the C++ STL version it 
ships with.

I wanted to point you to
CMAKE_CXX_KNOWN_FEATURES.html , but has-make-unique is not one other features 
CMake knows about.

As Sven points out, using symbol_exists() might work, or easier might be a 
try_compile() which will definitely tell you if std::make_unique<T> compiles on 
the local system.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list