https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79091
--- Comment #4 from Nathan Sidwell <nathan at gcc dot gnu.org> --- Created attachment 40530 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40530&action=edit further reduced testcase this testcase compiles -- remove the 'q' tag from the enum to make it barf. But the interesting thing is that the instantiations of Bar and Baz return the same type, but are mangled completely differently. Bar's mangling mangles the unfolded non-type template parm as 'quT_L1q1ELi0E' ('(1)?((q)1) : (0)') I recall that's an ABI rule, but I need to check. gcc-6 mangles it that way too, but for some reason doesn't barf.