Skip to content

Variadic pack at the beginning of function parameters not seen as a non-deduced context #16171

@llvmbot

Description

@llvmbot
Bugzilla Link 15799
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

The following simple snippet fails to compile:

template<typename T> struct any{ template<typename U> any(U){} };
 
template<typename... Ts, typename T>
T back(any<Ts>..., T);
 
int main(){
    using _ = decltype(back<int>(true, 42));
}

With:

main.cpp:7:24: error: no matching function for call to 'back'
    using _ = decltype(back<int>(true, 42));
                       ^~~~~~~~~
main.cpp:4:3: note: candidate template ignored: couldn't infer template argument 'T'
T back(any<Ts>..., T);

May be related to http://llvm.org/bugs/show_bug.cgi?id=9020

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions