Re: LLVM breakage on seawasp - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: LLVM breakage on seawasp
Date
Msg-id CA+hUKGJ_1a4V03BnRadb24d+iVD0HKKePdA5AWky_jhJnNSAqA@mail.gmail.com
Whole thread Raw
In response to Re: LLVM breakage on seawasp  (Andres Freund <andres@anarazel.de>)
Responses Re: LLVM breakage on seawasp  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sun, Aug 25, 2019 at 8:24 AM Andres Freund <andres@anarazel.de> wrote:
> On August 24, 2019 1:08:11 PM PDT, Thomas Munro <thomas.munro@gmail.com> wrote:
> >Perhaps we'll need some macrology to select between llvm and std
> >versions?  I am guessing we can't decree that PostgreSQL's minimum C++
> >level is C++14 and simply change it to std::make_unique.
>
> Perhaps just a
> #if new_enough
> using std::make_unique
> #else
> using  llvm::mak_eunique
>
> At the start of the file, and then use it unqualified?

Yeah, it's a pain though, you'd have to say:

#if llvm >= 9
#  if cpp >= 14
#    using std::make_unique;
#  else
#    error "postgres needs at least c++ 14 to use llvm 9"
#  endif
#else
#  using llvm::make_unique;
#endif

Maybe we should just use std::unique_ptr's constructor, ie give it new
ImportMayTy() instead of using make_unique(), even though that's not
cool C++ these days?

-- 
Thomas Munro
https://enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: LLVM breakage on seawasp
Next
From: Tom Lane
Date:
Subject: Re: LLVM breakage on seawasp