Re: [HACKERS] static assertions in C++

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] static assertions in C++
Date: 2017-12-26 15:51:25
Message-ID: 66c291ff-8b53-d240-ea7f-3370372bfd39@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/20/17 10:51, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> On 12/20/17 00:57, Tom Lane wrote:
>>> I do not have a well-informed opinion on whether
>>> #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410
>>> is an appropriate test for static_assert() being available, but I'm
>>> pretty suspicious of it because none of my C++ compilers seem to
>>> take that path, not even recent stuff like clang 9.0.0.
>
>> For clang, you apparently need to pass -std=c++11 or higher. With g++
>>> =6, that's the default.
>
> Ah. I did try -std=c++0x on one machine, but forgot to do so with
> the newer clang. That does seem to make it take the static_assert
> path on recent macOS.

committed

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-12-26 16:31:03 Re: Deadlock in multiple CIC.
Previous Message Dmitry Dolgov 2017-12-26 14:50:45 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions