- Fix `#57008 <https://github.com/llvm/llvm-project/issues/57008>`_ - Builtin
C++ language extension type traits instantiated by a template with unexpected
number of arguments cause an assertion fault.
+- Fix multi-level pack expansion of undeclared function parameters.
+ This fixes `Issue 56094 <https://github.com/llvm/llvm-project/issues/56094>`_.
+
Improvements to Clang's diagnostics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= dyn_cast<PackExpansionType>(OldType)) {
// We have a function parameter pack that may need to be expanded.
QualType Pattern = Expansion->getPattern();
+ NumExpansions = Expansion->getNumExpansions();
SmallVector<UnexpandedParameterPack, 2> Unexpanded;
getSema().collectUnexpandedParameterPacks(Pattern, Unexpanded);
bar(b);
}
}
+
+namespace pr56094 {
+template <typename... T> struct D {
+ template <typename... U> using B = int(int (*...p)(T, U));
+ // expected-error@-1 {{pack expansion contains parameter pack 'U' that has a different length (1 vs. 2) from outer parameter packs}}
+ template <typename U1, typename U2> D(B<U1, U2> *);
+ // expected-note@-1 {{in instantiation of template type alias 'B' requested here}}
+};
+using t1 = D<float>::B<int>;
+// expected-note@-1 {{in instantiation of template class 'pr56094::D<float>' requested here}}
+
+template <bool...> struct F {};
+template <class...> struct G {};
+template <bool... I> struct E {
+ template <bool... U> using B = G<F<I, U>...>;
+ // expected-error@-1 {{pack expansion contains parameter pack 'U' that has a different length (1 vs. 2) from outer parameter packs}}
+ template <bool U1, bool U2> E(B<U1, U2> *);
+ // expected-note@-1 {{in instantiation of template type alias 'B' requested here}}
+};
+using t2 = E<true>::B<false>;
+// expected-note@-1 {{in instantiation of template class 'pr56094::E<true>' requested here}}
+} // namespace pr56094