PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
authorMarek Polacek <polacek@redhat.com>
Mon, 23 Sep 2019 17:37:54 +0000 (17:37 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 23 Sep 2019 17:37:54 +0000 (17:37 +0000)
commit1a09197cb1bc05a71d1866d1220937289da02c5e
treeaefb9cfa8c4542ee2235dc93fa2107880eaf40b1
parentba2b30dc9fa9190101b3eb7ae10415b54ca25e7a
PR c++/91844 - Implement CWG 2352, Similar types and reference binding.

* call.c (reference_related_p): Use similar_type_p instead of
same_type_p.
(reference_compatible_p): Update implementation to match CWG 2352.
* cp-tree.h (similar_type_p): Declare.
* typeck.c (similar_type_p): New.

* g++.dg/cpp0x/pr33930.C: Add dg-error.
* g++.dg/cpp0x/ref-bind1.C: New test.
* g++.dg/cpp0x/ref-bind2.C: New test.
* g++.dg/cpp0x/ref-bind3.C: New test.
* g++.old-deja/g++.pt/spec35.C: Remove dg-error.

From-SVN: r276058
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr33930.C
gcc/testsuite/g++.dg/cpp0x/ref-bind1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/ref-bind2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/ref-bind3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/spec35.C