public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
@ 2016-01-28  0:49 John David Anglin
  2016-01-28 10:46 ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: John David Anglin @ 2016-01-28  0:49 UTC (permalink / raw)
  To: GCC Patches; +Cc: libstdc++, Jonathan Wakely

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

The attached patch fixes a stage1 build error compiling genautomata.c on hpux.  We need to test for obsolete
XOPEN declarations of isinf and isnan on hpux.  Further, we need to check individually for isinf and isnan on hpux11
since only isnan has an obsolete XOPEN declaration.

Tested on hppa2.0w-hp-hpux11.11.

Okay for trunk?

Dave
--
John David Anglin	dave.anglin@bell.net



[-- Attachment #2: libstdc++-isnan.d.txt --]
[-- Type: text/plain, Size: 3954 bytes --]

2016-01-27  John David Anglin  <danglin@gcc.gnu.org>

	PR libstdc++/69450
	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Split check for obsolete
	isinf and isnan functions into two independent checks.  Check on hpux.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/c_global/cmath (isinf(double), isnan(double)): Use
	_GLIBCXX_HAVE_OBSOLETE_ISINF and _GLIBCXX_HAVE_OBSOLETE_ISNAN,
	respectively.

Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 232776)
+++ acinclude.m4	(working copy)
@@ -2186,39 +2186,54 @@
       fi
       AC_MSG_RESULT([$glibcxx_cv_math11_overload])
       ;;
-    *-*-*gnu* | *-*-aix*)
+    *-*-*gnu* | *-*-aix* | *-*-hpux*)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>
       # and must use the ones from <math.h> instead.
-      AC_MSG_CHECKING([for obsolete isinf and isnan functions in <math.h>])
-        AC_CACHE_VAL(glibcxx_cv_obsolete_isinf_isnan, [
+      AC_MSG_CHECKING([for obsolete isinf function in <math.h>])
+        AC_CACHE_VAL(glibcxx_cv_obsolete_isinf, [
           AC_COMPILE_IFELSE([AC_LANG_SOURCE(
             [#include <math.h>
              #undef isinf
-             #undef isnan
              namespace std {
                using ::isinf;
                bool isinf(float);
                bool isinf(long double);
+             }
+             using std::isinf;
+             bool b = isinf(0.0);
+          ])],
+          [glibcxx_cv_obsolete_isinf=yes],
+          [glibcxx_cv_obsolete_isinf=no]
+        )])
+      AC_MSG_RESULT([$glibcxx_cv_obsolete_isinf])
+      if test $glibcxx_cv_obsolete_isinf = yes; then
+        AC_DEFINE(HAVE_OBSOLETE_ISINF, 1,
+                  [Define if <math.h> defines obsolete isinf function.])
+      fi
+
+      AC_MSG_CHECKING([for obsolete isnan function in <math.h>])
+        AC_CACHE_VAL(glibcxx_cv_obsolete_isnan, [
+          AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+            [#include <math.h>
+             #undef isnan
+             namespace std {
                using ::isnan;
                bool isnan(float);
                bool isnan(long double);
              }
-             using std::isinf;
              using std::isnan;
-             bool b = isinf(0.0) || isnan(0.0);
+             bool b = isnan(0.0);
           ])],
-          [glibcxx_cv_obsolete_isinf_isnan=yes],
-          [glibcxx_cv_obsolete_isinf_isnan=no]
+          [glibcxx_cv_obsolete_isnan=yes],
+          [glibcxx_cv_obsolete_isnan=no]
         )])
-
-
-      if test $glibcxx_cv_obsolete_isinf_isnan = yes; then
-        AC_DEFINE(HAVE_OBSOLETE_ISINF_ISNAN, 1,
-                  [Define if <math.h> defines obsolete isinf and isnan functions.])
+      AC_MSG_RESULT([$glibcxx_cv_obsolete_isnan])
+      if test $glibcxx_cv_obsolete_isnan = yes; then
+        AC_DEFINE(HAVE_OBSOLETE_ISNAN, 1,
+                  [Define if <math.h> defines obsolete isnan function.])
       fi
-      AC_MSG_RESULT([$glibcxx_cv_obsolete_isinf_isnan])
       ;;
   esac
 
Index: include/c_global/cmath
===================================================================
--- include/c_global/cmath	(revision 232776)
+++ include/c_global/cmath	(working copy)
@@ -610,7 +610,7 @@
   isinf(float __x)
   { return __builtin_isinf(__x); }
 
-#if _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN \
+#if _GLIBCXX_HAVE_OBSOLETE_ISINF \
   && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
   using ::isinf;
 #else
@@ -635,7 +635,7 @@
   isnan(float __x)
   { return __builtin_isnan(__x); }
 
-#if _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN \
+#if _GLIBCXX_HAVE_OBSOLETE_ISNAN \
   && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
   using ::isnan;
 #else

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-01-28  0:49 [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration John David Anglin
@ 2016-01-28 10:46 ` Jonathan Wakely
  2016-02-04 22:11   ` Gerald Pfeifer
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2016-01-28 10:46 UTC (permalink / raw)
  To: John David Anglin; +Cc: GCC Patches, libstdc++, Jonathan Wakely

On 27/01/16 19:49 -0500, John David Anglin wrote:
>The attached patch fixes a stage1 build error compiling genautomata.c on hpux.  We need to test for obsolete
>XOPEN declarations of isinf and isnan on hpux.  Further, we need to check individually for isinf and isnan on hpux11
>since only isnan has an obsolete XOPEN declaration.
>
>Tested on hppa2.0w-hp-hpux11.11.

Also tests OK on x86_64-linux (with glibc 2.22).

>Okay for trunk?

Yes, OK, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-01-28 10:46 ` Jonathan Wakely
@ 2016-02-04 22:11   ` Gerald Pfeifer
  2016-02-04 22:31     ` John David Anglin
  2016-02-04 22:49     ` Jonathan Wakely
  0 siblings, 2 replies; 10+ messages in thread
From: Gerald Pfeifer @ 2016-02-04 22:11 UTC (permalink / raw)
  To: Jonathan Wakely, John David Anglin
  Cc: gcc-patches, libstdc++, Jonathan Wakely

On Thu, 28 Jan 2016, Jonathan Wakely wrote:
> On 27/01/16 19:49 -0500, John David Anglin wrote:
>> The attached patch fixes a stage1 build error compiling genautomata.c 
>> on hpux.  We need to test for obsolete XOPEN declarations of isinf and 
>> isnan on hpux.  Further, we need to check individually for isinf and 
>> isnan on hpux11 since only isnan has an obsolete XOPEN declaration.
>> Tested on hppa2.0w-hp-hpux11.11.
> Also tests OK on x86_64-linux (with glibc 2.22).

It seems to break older versions of FreeBSD that have GCC 4.2
as their system compiler.  (Those versions aren't actually all
that old, they are stuck with GCC 4.2 as the last version under
GPLv2.)


In file included from .././../gcc-6-20160131/gcc/genautomata.c:116:0:
/wrkdirs/usr/ports/lang/gcc6-devel/work/gcc-6-20160131/libstdc++-v3/include/c_compatibility/math.h:65:12: 
error: 'constexpr bool std::isinf(double)' conflicts with a previous declaration
 using std::isinf;
            ^~~~~ 

See 
http://beefy2.nyi.freebsd.org/data/93amd64-default/408008/logs/gcc6-devel-6.0.0.s20160131.log 
for a full log.

Gerald

PS: I don't have direct access to this system, or I'd provide
preprocessed headers.  If you need those, I can try to create
a VM and get things reproduced there.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-04 22:11   ` Gerald Pfeifer
@ 2016-02-04 22:31     ` John David Anglin
  2016-02-04 22:41       ` Jonathan Wakely
  2016-02-04 22:49     ` Jonathan Wakely
  1 sibling, 1 reply; 10+ messages in thread
From: John David Anglin @ 2016-02-04 22:31 UTC (permalink / raw)
  To: Gerald Pfeifer, Jonathan Wakely; +Cc: gcc-patches, libstdc++, Jonathan Wakely

On 2016-02-04 5:11 PM, Gerald Pfeifer wrote:
> In file included from .././../gcc-6-20160131/gcc/genautomata.c:116:0:
> /wrkdirs/usr/ports/lang/gcc6-devel/work/gcc-6-20160131/libstdc++-v3/include/c_compatibility/math.h:65:12:
> error: 'constexpr bool std::isinf(double)' conflicts with a previous declaration
>   using std::isinf;
>              ^~~~~
>
> See
> http://beefy2.nyi.freebsd.org/data/93amd64-default/408008/logs/gcc6-devel-6.0.0.s20160131.log  
> for a full log.
The checks for obsolete isinf(double) and isnan(double) are not run on 
freebsd.  Apparently,
the checks in acinclude.m4 need to be run on freebsd as well.  Maybe the 
checks should run almost
everywhere?

The problem wasn't introduced by my change but earlier by Jonathan. I 
added hpux to the list
of systems with obsolete defines.  The default is to assume there are no 
obsolete defines.

Dave

--
John David Anglin  dave.anglin@bell.net

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-04 22:31     ` John David Anglin
@ 2016-02-04 22:41       ` Jonathan Wakely
  2016-02-05  1:01         ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2016-02-04 22:41 UTC (permalink / raw)
  To: John David Anglin; +Cc: Gerald Pfeifer, gcc-patches, libstdc++, Jonathan Wakely

On 04/02/16 17:31 -0500, John David Anglin wrote:
>On 2016-02-04 5:11 PM, Gerald Pfeifer wrote:
>>In file included from .././../gcc-6-20160131/gcc/genautomata.c:116:0:
>>/wrkdirs/usr/ports/lang/gcc6-devel/work/gcc-6-20160131/libstdc++-v3/include/c_compatibility/math.h:65:12:
>>error: 'constexpr bool std::isinf(double)' conflicts with a previous declaration
>>  using std::isinf;
>>             ^~~~~
>>
>>See
>>http://beefy2.nyi.freebsd.org/data/93amd64-default/408008/logs/gcc6-devel-6.0.0.s20160131.log  
>>for a full log.
>The checks for obsolete isinf(double) and isnan(double) are not run on 
>freebsd.  Apparently,
>the checks in acinclude.m4 need to be run on freebsd as well.  Maybe 
>the checks should run almost
>everywhere?

Yes, maybe. I didn't realise those functions were so widespread, but
if they are I'm amazed more people weren't yelling about
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891

>The problem wasn't introduced by my change but earlier by Jonathan. I 
>added hpux to the list
>of systems with obsolete defines.  The default is to assume there are 
>no obsolete defines.

I think it should be harmless to run the checks on all systems. If
they don't have obsolete defines we'll detect that. If they do things
will start working.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-04 22:11   ` Gerald Pfeifer
  2016-02-04 22:31     ` John David Anglin
@ 2016-02-04 22:49     ` Jonathan Wakely
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Wakely @ 2016-02-04 22:49 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: John David Anglin, gcc-patches, libstdc++, Jonathan Wakely

On 04/02/16 23:11 +0100, Gerald Pfeifer wrote:
>It seems to break older versions of FreeBSD that have GCC 4.2
>as their system compiler.  (Those versions aren't actually all
>that old, they are stuck with GCC 4.2 as the last version under
>GPLv2.)

The version of GCC doesn't matter, it's whether libc declares those
functions or not.

I tested the change on modern versions of FreeBSD and DragonFly which
have the following so don't declare them:

/*
 * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
 * isinf() as functions taking double.  C99, and the subsequent POSIX revisions
 * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
 * point type.  If we are targeting SUSv2 and C99 or C11 (or C++11) then we
 * expose the newer definition, assuming that the language spec takes
 * precedence over the operating system interface spec.
 */
#if     __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999
#undef isinf
#undef isnan
int     isinf(double);
int     isnan(double);
#endif

I'll enable the configure test for all targets and check that it's OK
on these ones which definitely don't declare the obsolete functions.
It should also fix it on systems that do declare them.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-04 22:41       ` Jonathan Wakely
@ 2016-02-05  1:01         ` Jonathan Wakely
  2016-02-06 12:51           ` Gerald Pfeifer
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2016-02-05  1:01 UTC (permalink / raw)
  To: John David Anglin; +Cc: Gerald Pfeifer, gcc-patches, libstdc++, Jonathan Wakely

[-- Attachment #1: Type: text/plain, Size: 1563 bytes --]

On 04/02/16 22:41 +0000, Jonathan Wakely wrote:
>On 04/02/16 17:31 -0500, John David Anglin wrote:
>>On 2016-02-04 5:11 PM, Gerald Pfeifer wrote:
>>>In file included from .././../gcc-6-20160131/gcc/genautomata.c:116:0:
>>>/wrkdirs/usr/ports/lang/gcc6-devel/work/gcc-6-20160131/libstdc++-v3/include/c_compatibility/math.h:65:12:
>>>error: 'constexpr bool std::isinf(double)' conflicts with a previous declaration
>>> using std::isinf;
>>>            ^~~~~
>>>
>>>See
>>>http://beefy2.nyi.freebsd.org/data/93amd64-default/408008/logs/gcc6-devel-6.0.0.s20160131.log  
>>>for a full log.
>>The checks for obsolete isinf(double) and isnan(double) are not run 
>>on freebsd.  Apparently,
>>the checks in acinclude.m4 need to be run on freebsd as well.  Maybe 
>>the checks should run almost
>>everywhere?
>
>Yes, maybe. I didn't realise those functions were so widespread, but
>if they are I'm amazed more people weren't yelling about
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891
>
>>The problem wasn't introduced by my change but earlier by Jonathan. 
>>I added hpux to the list
>>of systems with obsolete defines.  The default is to assume there 
>>are no obsolete defines.
>
>I think it should be harmless to run the checks on all systems. If
>they don't have obsolete defines we'll detect that. If they do things
>will start working.

This works on powerpc64-linux (with glibc 2.18 which does define those
functions) and x86_64-freebsd10.2 (which doesn't define them).

Can anyone else test this on an older FreeBSD or other target that
isn't gnu/aix/hpux?


[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1515 bytes --]

commit 8be7de1a900b22622b7f4ef3534572dfb1f52892
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 4 23:54:47 2016 +0000

    Enable isinf/isnan checks for all targets
    
    	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Enable checks for
    	obsolete isinf and isnan for all targets except *-*-solaris2.*.
    	* configure: Regenerate.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 057b58e..bdcb264 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2215,7 +2215,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
       fi
       AC_MSG_RESULT([$glibcxx_cv_math11_overload])
       ;;
-    *-*-*gnu* | *-*-aix* | *-*-hpux*)
+    *)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a919a3e..c3f627f 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -18266,7 +18266,7 @@ fi
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_overload" >&5
 $as_echo "$glibcxx_cv_math11_overload" >&6; }
       ;;
-    *-*-*gnu* | *-*-aix* | *-*-hpux*)
+    *)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-05  1:01         ` Jonathan Wakely
@ 2016-02-06 12:51           ` Gerald Pfeifer
  2016-02-06 15:31             ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 2016-02-06 12:51 UTC (permalink / raw)
  To: Jonathan Wakely
  Cc: John David Anglin, gcc-patches, libstdc++, Jonathan Wakely

On Fri, 5 Feb 2016, Jonathan Wakely wrote:
> Can anyone else test this on an older FreeBSD or other target that
> isn't gnu/aix/hpux?

Thank you, Jonathan!

I did not have such an older environment available, but now
could install the infrastructure and get all prerequisites 
in place for FreeBSD 9.3/AMD64 testing.

That allowed to both reproduce the original failure and confirm
that it does not occur any more with your proposed patch.

Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-06 12:51           ` Gerald Pfeifer
@ 2016-02-06 15:31             ` Jonathan Wakely
  2016-02-08 16:01               ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2016-02-06 15:31 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Jonathan Wakely, John David Anglin, gcc-patches, libstdc++

On 6 February 2016 at 12:51, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Fri, 5 Feb 2016, Jonathan Wakely wrote:
>>
>> Can anyone else test this on an older FreeBSD or other target that
>> isn't gnu/aix/hpux?
>
>
> Thank you, Jonathan!
>
> I did not have such an older environment available, but now
> could install the infrastructure and get all prerequisites in place for
> FreeBSD 9.3/AMD64 testing.
>
> That allowed to both reproduce the original failure and confirm
> that it does not occur any more with your proposed patch.

OK, thanks. I'll commit it on Monday (with a slight tweak).

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration
  2016-02-06 15:31             ` Jonathan Wakely
@ 2016-02-08 16:01               ` Jonathan Wakely
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Wakely @ 2016-02-08 16:01 UTC (permalink / raw)
  To: gcc-patches, libstdc++; +Cc: Gerald Pfeifer, John David Anglin

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

On 06/02/16 15:31 +0000, Jonathan Wakely wrote:
>On 6 February 2016 at 12:51, Gerald Pfeifer <gerald@pfeifer.com> wrote:
>> On Fri, 5 Feb 2016, Jonathan Wakely wrote:
>>>
>>> Can anyone else test this on an older FreeBSD or other target that
>>> isn't gnu/aix/hpux?
>>
>>
>> Thank you, Jonathan!
>>
>> I did not have such an older environment available, but now
>> could install the infrastructure and get all prerequisites in place for
>> FreeBSD 9.3/AMD64 testing.
>>
>> That allowed to both reproduce the original failure and confirm
>> that it does not occur any more with your proposed patch.
>
>OK, thanks. I'll commit it on Monday (with a slight tweak).

This enables the isinf/isnan checks everywhere and also adds #define
_GLIBCXX_INCLUDE_NEXT_C_HEADERS to the configure test, to ensure that
it finds the libc math.h and not an already installed libstdc++
wrapper (which would confuse the test). I also accidentally committed
a change to add 'constexpr' to the configure test, which I reverted.

Tested powerp64-linux, committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 2815 bytes --]

commit b0a7399294012b65df3d155da0182e017d6e4214
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Feb 8 15:22:32 2016 +0000

    Enable isinf/isnan checks for all targets
    
    	PR libstdc++/48891
    	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Enable isinf and isnan
    	checks for all targets except *-*-solaris2.* and ensure we find the
    	libc math.h header not our own.
    	* configure: Regenerate.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233214 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 057b58e..e667ccc 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2215,7 +2215,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
       fi
       AC_MSG_RESULT([$glibcxx_cv_math11_overload])
       ;;
-    *-*-*gnu* | *-*-aix* | *-*-hpux*)
+    *)
       # If <math.h> defines the obsolete isinf(double) and isnan(double)
       # functions (instead of or as well as the C99 generic macros) then we
       # can't define std::isinf(double) and std::isnan(double) in <cmath>
@@ -2223,12 +2223,13 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
       AC_MSG_CHECKING([for obsolete isinf function in <math.h>])
         AC_CACHE_VAL(glibcxx_cv_obsolete_isinf, [
           AC_COMPILE_IFELSE([AC_LANG_SOURCE(
-            [#include <math.h>
+            [#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+             #include <math.h>
              #undef isinf
              namespace std {
                using ::isinf;
-               bool isinf(float);
-               bool isinf(long double);
+               constexpr bool isinf(float);
+               constexpr bool isinf(long double);
              }
              using std::isinf;
              bool b = isinf(0.0);

commit 6c1b4080c3cd651e3559bbbf155d1f09236c68ee
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Feb 8 15:37:59 2016 +0000

    Remove accidentally added 'constexpr' in previous commit
    
    	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Remove accidentally
    	added 'constexpr' in previous commit.
    	* configure: Regenerate.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233219 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index e667ccc..95df24a 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2228,8 +2228,8 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
              #undef isinf
              namespace std {
                using ::isinf;
-               constexpr bool isinf(float);
-               constexpr bool isinf(long double);
+               bool isinf(float);
+               bool isinf(long double);
              }
              using std::isinf;
              bool b = isinf(0.0);

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-08 16:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28  0:49 [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration John David Anglin
2016-01-28 10:46 ` Jonathan Wakely
2016-02-04 22:11   ` Gerald Pfeifer
2016-02-04 22:31     ` John David Anglin
2016-02-04 22:41       ` Jonathan Wakely
2016-02-05  1:01         ` Jonathan Wakely
2016-02-06 12:51           ` Gerald Pfeifer
2016-02-06 15:31             ` Jonathan Wakely
2016-02-08 16:01               ` Jonathan Wakely
2016-02-04 22:49     ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).