[Bug c++/81349] Classes with deleted constructor templates incorrectly labeled as non-aggregates
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 26 08:32:18 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81349
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:dab932d1519ba07fb4c49e6849ee7ceb02c0d603
commit r10-7394-gdab932d1519ba07fb4c49e6849ee7ceb02c0d603
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Mar 26 09:31:15 2020 +0100
c++: Fix up user_provided_p [PR81349]
The standard says: "A function is user-provided if it is user-declared and
not explicitly defaulted or deleted on its first declaration."
I don't see anything about function templates having different rules here,
but user_provided_p does return true for all TEMPLATE_DECLs.
The following patch fixes it by treating as user-provided only templates
that aren't deleted.
2020-03-26 Jakub Jelinek <jakub@redhat.com>
PR c++/81349
* class.c (user_provided_p): Use STRIP_TEMPLATE instead of
returning
true for all TEMPLATE_DECLs.
* g++.dg/cpp1z/pr81349.C: New test.
More information about the Gcc-bugs
mailing list