Skip to content

[cwg1467] Overload resolution not working with initializer_list and bool #22633

@llvmbot

Description

@llvmbot
Bugzilla Link 22259
Version 3.5
OS Linux
Depends On #10531
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

Test case.

#include <string>
#include <iostream>

void Test(const bool arg) 
{
    std::cout << "Wrong[" << arg << "]" << std::endl;
}
void Test(const std::initializer_list<std::string> arg)
{
    std::cout << "Right[" << arg.size() << "]" << std::endl;
}
    
int main (int /*argc*/, char * const /*argv*/[]) 
{
    Test({"false"});
    return 0;
}

This should print:

  Right[1]

Instead I get:

  Wrong[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang: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