// RUN: %clang_cc1 -verify %s -std=c++17 -Wno-unused template void PackInsideTypedefDeclaration() { ([] { typedef Ts Type; (void)Type(); }(), ...); } template void PackInsideTypedefDeclaration<>(); template void PackInsideTypedefDeclaration(); template void PackInsideTypedefDeclaration(); template void PackInsideTypedefDeclarationInvalid() { [] { // expected-error {{contains unexpanded parameter pack 'Ts'}} typedef Ts Type; (void)Type(); }; ([] { typedef Ts Type; // A reference to a typedef containing an unexpanded pack does not // itself contain an unexpanded pack. f(Type()...); // expected-error {{does not contain any unexpanded}} }, ...); } template void PackInsideAliasDeclaration() { ([] { using Type = Ts; (void)Type(); }(), ...); } template void PackInsideAliasDeclaration<>(); template void PackInsideAliasDeclaration(); template void PackInsideAliasDeclaration(); template void PackInsideAliasDeclarationInvalid() { [] { // expected-error {{contains unexpanded parameter pack 'Ts'}} using Type = Ts; (void)Type(); }; ([] { using Type = Ts; // A reference to an alias containing an unexpanded pack does not // itself contain an unexpanded pack. f(Type()...); // expected-error {{does not contain any unexpanded}} }, ...); } template void PackInsideUsingDeclaration() { ([] { struct A { using Type = Ts; }; struct B : A { using typename A::Type; }; (void)typename B::Type(); }(), ...); } template void PackInsideUsingDeclaration<>(); template void PackInsideUsingDeclaration(); template void PackInsideUsingDeclaration(); template void PackInsideUsingDeclarationInvalid() { ([] { struct A { using Type = Ts; }; struct B : A { using typename A::Type...; // expected-error {{does not contain any unexpanded}} }; }(), ...); } template void PackInsideVarDeclaration() { ([] { Ts ts; (void)ts; }, ...); } template void PackInsideVarDeclaration<>(); template void PackInsideVarDeclaration(); template void PackInsideVarDeclaration(); template void PackInsideVarDeclarationInvalid() { [] { // expected-error {{contains unexpanded parameter pack 'Ts'}} Ts ts; (void)ts; }; } template void PackInsideFunctionDeclaration() { ([] { Ts ts(Ts); ts({}); }, ...); } template void PackInsideFunctionDeclaration<>(); template void PackInsideFunctionDeclaration(); template void PackInsideFunctionDeclaration(); template void PackInsideFunctionDeclarationInvalid() { [] { // expected-error {{contains unexpanded parameter pack 'Ts'}} Ts ts(Ts); ts({}); }; } template void PackInsideLocalClass() { ([] { class Local { Ts ts; }; Local l; }, ...); } template void PackInsideLocalClass<>(); template void PackInsideLocalClass(); template void PackInsideLocalClass(); template void PackInsideLocalClassInvalid() { [] { // expected-error {{contains unexpanded parameter pack 'Ts'}} class Local { Ts ts; }; Local l; }; } template using Int = int; struct AClass {}; template using Class = AClass; template void HiddenPack() { (Int(), ...); (Int{}, ...); (Class(), ...); (Class{}, ...); ([] { Int(); }, ...); ([] { Int{}; }, ...); ([] { Class(); }, ...); ([] { Class{}; }, ...); } template void HiddenPack<>(); template void HiddenPack(); template void HiddenPack(); template void HiddenPackInvalid() { Int(); // expected-error {{unexpanded}} Int{}; // expected-error {{unexpanded}} Class(); // expected-error {{unexpanded}} Class{}; // expected-error {{unexpanded}} }