Discussion:
[patch #9572] ax_cxx_compile_stdcxx.m4: Drop the check for default C++ version support
Krzesimir Nowak
2018-02-21 14:39:21 UTC
Permalink
URL:
<http://savannah.gnu.org/patch/?9572>

Summary: ax_cxx_compile_stdcxx.m4: Drop the check for default
C++ version support
Project: GNU Autoconf Archive
Submitted by: krnowak
Submitted on: Wed 21 Feb 2018 02:39:20 PM UTC
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any

_______________________________________________________

Details:

The problem with the check is that it can't detect whether the version is with
extensions or not. So it can't take the "noext" or "ext" option into account.

This may be a problem when an extended version of C++ has a feature that
conflicts with another feature from the C++ standard and we have no way to
tell the macro to add a "-std" flag anyway.

An example:

using namespace std::complex_literals;
std::complex<double> c = 1.0;
c += 1.0i;
std::cout << "abs" << c << " = " << abs(c) << '\n';

Here, the "1.0i" constant is either a GCC extension if compiled with
-std=gnu++14 or a standard C++ operator if compiled with -std=c++14. If a GCC
extension is used, the snippet fails to compile. Unfortunately, recent GCC
versions default to gnu++14, so this code fails to compile by default.

Dropping the check forces the macro to evaluate compiler flags with taking the
"ext"/"noext" option into account.

Issue spotted by Frédéric Mangano-Tarumi.




_______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 21 Feb 2018 02:39:20 PM UTC Name:
0001-ax_cxx_compile_stdcxx.m4-Drop-the-check-for-default-.patch Size: 3KiB
By: krnowak

<http://savannah.gnu.org/patch/download.php?file_id=43377>

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/patch/?9572>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Krzesimir Nowak
2018-04-19 17:57:03 UTC
Permalink
Additional Item Attachment, patch #9572 (project autoconf-archive):

File name: 0001-ax_cxx_compile_stdcxx.m4-Drop-the-check-for-default-.patch
Size:2 KB


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/patch/?9572>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Peter Simons
2018-04-19 19:42:41 UTC
Permalink
Update of patch #9572 (project autoconf-archive):

Status: None => Done
Open/Closed: Open => Closed

_______________________________________________________

Follow-up Comment #1:

Merged via https://github.com/peti/autoconf-archive/pull/152. Thank you very
much!

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/patch/?9572>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/

Loading...