https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83503
--- Comment #17 from Jason Merrill <jason at redhat dot com> --- On Wed, Jan 31, 2018 at 9:45 PM, msebor at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> wrote: > Jason, I'm only starting to look into it but if I understand your suggestion > correctly, I don't think the bug can be fixed by relying on attribute > exclusions. > > Based on the test cases alone (I haven't yet stepped through the code) the > underlying problem seems to be that explicit specializations "inherit" > attributes from their primary template rather than starting with a clean > slate. Often that will be correct; I don't think we want to require people to repeat all attributes on every explicit specialization. The problem here is that there's a conflicting attribute on the specialization, and we want that to win, so I'm suggesting that when we see that, we go through and remove conflicting attributes which came from the template.