Skip to content

Incorrect naming in parameter pack expansion #506

@pixeldexter

Description

@pixeldexter

https://cppinsights.io/s/5ced24b2

So, this code
template<class...Match>
bool search(char ch, Match&&...matchers) {
return (matchers(ch) || ...);
}
search('A', ::isalpha, ::isdigit, { lambda });

gets insighted into
bool search<... params...>(char ch, int (&matchers)(int) noexcept, int (&matchers)(int) noexcept, __lambda_12_50 && __matchers3)

Notice how first and second parameters are named 'matchers', but the third parameter is named 'matchers3'. It looks like there is an internal counter, it is just being output for lambda and not for regular function argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions