Open namniav opened 2 years ago
I am not even sure if they are explicit specializations because of missed template<>
.
@llvm/issue-subscribers-clang-frontend
I am not even sure if they are explicit specializations because of missed
template<>
.
Thats right, they are not.
@languagelawyer May I ask if this is valid code or Clang incorrectly accepts invalid code or it is UB/ill-formed NDR ?
See e.g. https://stackoverflow.com/questions/63648248/difference-in-behaviour-between-clang-and-gcc-when-using-a-function-definition-a and the change by p1787 (currently http://eel.is/c++draft/dcl.meaning.general#1.sentence-2)
So, according to the current wording, such friend declarations are ill-formed because they are not of those forms where a template-id as a declarator-id is allowed.
I'm surprised I couldn't find an earlier bug report about this. Although, it could be claimed that the new clarified wording is too fresh.
n4861-temp.expl.spec
Clang compiles this code: https://godbolt.org/z/eeah47bvb