https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71243
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The code is not valid in C++11, only C++14, and it seems that GCC 5 doesn't implement the C++14 rules fully. Since it's already fixed in GCC 6 I think this can be closed as FIXED.