c++: Fix NaN as C++20 template argument
authorJason Merrill <jason@redhat.com>
Tue, 16 Mar 2021 20:06:27 +0000 (16:06 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 16 Mar 2021 21:47:22 +0000 (17:47 -0400)
commita4101e5aafc512dc32b8d529b2bafb116a3612de
treee5e250e144643a110b9efeddd3f279b8d2b13bf2
parent0251051db64f13c9a31a05c8133c31dc50b2b235
c++: Fix NaN as C++20 template argument

C++20 allows floating-point types for non-type template parameters;
floating-point values are considered to be equivalent template arguments if
they are "identical", which conveniently seems to map onto an existing GCC
predicate.

gcc/cp/ChangeLog:

* tree.c (cp_tree_equal): Use real_identical.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nontype-float1.C: New test.
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp2a/nontype-float1.C [new file with mode: 0644]