diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -5804,8 +5804,8 @@ } bool TraverseTemplateName(TemplateName Template) { - if (auto *TTP = - dyn_cast(Template.getAsTemplateDecl())) + if (auto *TTP = llvm::dyn_cast_or_null( + Template.getAsTemplateDecl())) if (TTP->getDepth() == Depth) Used[TTP->getIndex()] = true; RecursiveASTVisitor:: diff --git a/clang/test/SemaTemplate/concepts-GH53354.cpp b/clang/test/SemaTemplate/concepts-GH53354.cpp new file mode 100644 --- /dev/null +++ b/clang/test/SemaTemplate/concepts-GH53354.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -std=c++20 -verify %s +// expected-no-diagnostics + +template