https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80841
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- For the original testcase, GCC accepts the code even for -std=c++17 starting with GCC 7.2.0 (and 8+) and rejected it in GCC 7.1.0 with: <source>: In function 'int main()': <source>:22:95: error: invalid use of incomplete type 'struct MaybeDestruct<const double&, Number, Just<const double&, input> >' using result = typename MaybeDestruct<const double&, Number, Just<const double&, input>>::result; ^~~~~~ <source>:8:8: note: declaration of 'struct MaybeDestruct<const double&, Number, Just<const double&, input> >' struct MaybeDestruct; ^~~~~~~~~~~~~ Which is how clang rejects it also for C++17 but accepts it for C++14. I have no idea what is correct really.