diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-12-17 10:13:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2024-12-17 10:13:24 +0100 |
commit | 88bfee560681d8248b89f130ada249e35ee2e344 (patch) | |
tree | 8763ce58a62008475e4250eb7493049f696e5c81 /gcc/tree-inline.h | |
parent | 9684e70952ac159ce0b838533ce4e9c98474e1a8 (diff) | |
download | gcc-88bfee560681d8248b89f130ada249e35ee2e344.zip gcc-88bfee560681d8248b89f130ada249e35ee2e344.tar.gz gcc-88bfee560681d8248b89f130ada249e35ee2e344.tar.bz2 |
c++: Diagnose earlier non-static data members with cv containing class type [PR116108]
In r10-6457 aka PR92593 fix a check has been added to reject
earlier non-static data members with current_class_type in templates,
as the deduction then can result in endless recursion in reshape_init.
It fixed the
template <class T>
struct S { S s = 1; };
S t{2};
crashes, but as the following testcase shows, didn't catch when there
are cv qualifiers on the non-static data member.
Fixed by using TYPE_MAIN_VARIANT.
2024-12-17 Jakub Jelinek <jakub@redhat.com>
PR c++/116108
gcc/cp/
* decl.cc (grokdeclarator): Pass TYYPE_MAIN_VARIANT (type)
rather than type to same_type_p when checking if the non-static
data member doesn't have current class type.
gcc/testsuite/
* g++.dg/cpp1z/class-deduction117.C: New test.
Diffstat (limited to 'gcc/tree-inline.h')
0 files changed, 0 insertions, 0 deletions