llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Matheus Izvekov (mizvekov)

<details>
<summary>Changes</summary>

A SubstTemplateTypeParmPackType is one of the types which may appear in a 
NestedNameSpecifier, so add it to the list of expected types in TreeTransform.

This fixes a regression introduced in #<!-- -->147835, which has never been 
released, so there are no release notes.

Fixes #<!-- -->154270

---
Full diff: https://github.com/llvm/llvm-project/pull/154418.diff


2 Files Affected:

- (modified) clang/lib/Sema/TreeTransform.h (+1) 
- (modified) clang/test/SemaTemplate/nested-name-spec-template.cpp (+12) 


``````````diff
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 51f58e35a1ef4..f46cb675805b5 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -5417,6 +5417,7 @@ QualType 
TreeTransform<Derived>::TransformTypeInObjectScope(
   case TypeLoc::Typedef:
   case TypeLoc::TemplateSpecialization:
   case TypeLoc::SubstTemplateTypeParm:
+  case TypeLoc::SubstTemplateTypeParmPackType:
   case TypeLoc::PackIndexing:
   case TypeLoc::Enum:
   case TypeLoc::Record:
diff --git a/clang/test/SemaTemplate/nested-name-spec-template.cpp 
b/clang/test/SemaTemplate/nested-name-spec-template.cpp
index e6cbe3812da52..6d4d759ab6b86 100644
--- a/clang/test/SemaTemplate/nested-name-spec-template.cpp
+++ b/clang/test/SemaTemplate/nested-name-spec-template.cpp
@@ -167,3 +167,15 @@ namespace unresolved_using {
   };
   template struct C<int>;
 } // namespace unresolved_using
+
+namespace SubstTemplateTypeParmPackType {
+  template <int...> struct A {};
+
+  template <class... Ts> void f() {
+    []<int ... Is>(A<Is...>) { (Ts::g(Is) && ...); }(A<0>{});
+  };
+
+  struct B { static void g(int); };
+
+  template void f<B>();
+} // namespace SubstTemplateTypeParmPackType

``````````

</details>


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

Reply via email to