================
@@ -3406,6 +3406,10 @@ static QualType checkBuiltinTemplateIdType(
     Sema &SemaRef, ElaboratedTypeKeyword Keyword, BuiltinTemplateDecl *BTD,
     ArrayRef<TemplateArgument> Converted, SourceLocation TemplateLoc,
     TemplateArgumentListInfo &TemplateArgs) {
+  if (llvm::any_of(Converted,
+                   [](const TemplateArgument &A) { return A.isDependent(); }))
+    return QualType();
----------------
ojhunt wrote:

Oh huh, I wouldn't have thought of doing it this way. Good call.

Are we able to check that the minimum arg count is reached? e.g 
```cpp
__some_builtin_template<{some template parameter set}>(...)
```
is always invalid if there are insufficient template parameters (assuming no 
packs), e.g we can error out on incorrect/insufficient template parameters even 
if they are dependent


https://github.com/llvm/llvm-project/pull/180407
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to