diff options
author | Marek Polacek <polacek@redhat.com> | 2020-06-22 21:26:49 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-07-14 19:24:34 -0400 |
commit | 315b87f63bcde4c881e9963c39d57258da08ccb5 (patch) | |
tree | 4b43b3777886b98853f6fd5eed090e04f22d66fe /libgomp | |
parent | a1c022d1b9a43f85f0c451b6422fd095a704fe96 (diff) | |
download | gcc-315b87f63bcde4c881e9963c39d57258da08ccb5.zip gcc-315b87f63bcde4c881e9963c39d57258da08ccb5.tar.gz gcc-315b87f63bcde4c881e9963c39d57258da08ccb5.tar.bz2 |
c++: Make convert_like complain about bad ck_ref_bind again [PR95789]
convert_like issues errors about bad_p conversions at the beginning
of the function, but in the ck_ref_bind case, it only issues them
after we've called convert_like on the next conversion.
This doesn't work as expected since r10-7096 because when we see
a conversion from/to class type in a template, we return early, thereby
missing the error, and a bad_p conversion goes by undetected. That
made the attached test to compile even though it should not.
I had thought that I could just move the ck_ref_bind/bad_p errors
above to the rest of them, but that regressed diagnostics because
expr then wasn't converted yet by the nested convert_like_real call.
So, for bad_p conversions, do the normal processing, but still return
the IMPLICIT_CONV_EXPR to avoid introducing trees that the template
processing can't handle well. This I achieved by adding a wrapper
function.
gcc/cp/ChangeLog:
PR c++/95789
PR c++/96104
PR c++/96179
* call.c (convert_like_real_1): Renamed from convert_like_real.
(convert_like_real): New wrapper for convert_like_real_1.
gcc/testsuite/ChangeLog:
PR c++/95789
PR c++/96104
PR c++/96179
* g++.dg/conversion/ref4.C: New test.
* g++.dg/conversion/ref5.C: New test.
* g++.dg/conversion/ref6.C: New test.
(cherry picked from commit 8e64d182850560dbedfabb88aac90d4fc6155067)
Diffstat (limited to 'libgomp')
0 files changed, 0 insertions, 0 deletions