================
@@ -78,6 +79,15 @@ matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
if (!TD || TD->getName() != "enable_if")
return std::nullopt;
+ const TemplateParameterList *Params = TD->getTemplateParameters();
+ if (Params->size() != 2)
+ return std::nullopt;
----------------
localspook wrote:
It looks like specializations of different kinds are represented in the AST as:
- `FunctionDecl`
- `VarTemplatePartialSpecializationDecl`
- `VarTemplateSpecializationDecl`
- `ClassTemplatePartialSpecializationDecl`
- `ClassTemplateSpecializationDecl`
None of those are subclasses of `TemplateDecl`. That means they wouldn't get
past the `getAsTemplateDecl()` check above, so I'm hesitantly removing this
check.
https://godbolt.org/z/PqeMe3fsx
https://github.com/llvm/llvm-project/pull/152938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits