https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90108
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Apr 30 21:07:37 2019 New Revision: 270754 URL: https://gcc.gnu.org/viewcvs?rev=270754&root=gcc&view=rev Log: Backported from mainline 2019-04-19 Jakub Jelinek <ja...@redhat.com> PR c++/90108 * c-decl.c (merge_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * decl.c (duplicate_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * c-c++-common/pr90108.c: New test. Added: branches/gcc-8-branch/gcc/testsuite/c-c++-common/pr90108.c Modified: branches/gcc-8-branch/gcc/c/ChangeLog branches/gcc-8-branch/gcc/c/c-decl.c branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/decl.c branches/gcc-8-branch/gcc/testsuite/ChangeLog