sdkrystian wrote:

@erichkeane 
> I guess my first question is 'why'? 

Per the comment you mentioned, it is redundant. Switching to 
`DependentFunctionTemplateSpecializationInfo` also results in constructs such 
as:

```
template<typename T>
struct A {
  template<>
  void f();
};
```

being diagnosed prior to instantiation. Class scope explicit specializations 
currently exist in their own broken little corner of the frontend, so unifying 
their representation in the AST would be the first step towards properly fixing 
them. 

> My second is 'if this is unnecessary, why was it here in the first place?`. 

`ClassScopeFunctionSpecializationDecl` was originally added in [this 
commit](https://github.com/llvm/llvm-project/commit/00c7e6ceb1826baab50c02f8547e97bfcaf9641c)
 to "parse MSVC standard C++ headers, MFC and ATL code." Back then, class scope 
explicit specializations were a Microsoft extension, but since 
[CWG727](https://wg21.link/cwg727) they are valid ISO C++. As for why this was 
not originally implemented using `DependentFunctionTemplateSpecializationInfo`, 
I cannot say.

https://github.com/llvm/llvm-project/pull/66636
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to