https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61242

            Bug ID: 61242
           Summary: [4.9/4.10 Regression] Bogus "no matching function for
                    call to ‘Foo::Create(<brace-enclosed initializer
                    list>)"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

This worked as recently as r200178, is broken in at least r210292 and later.

struct Foo
{
  struct A
  {
    const int &container;
    const int &args;
  };
  static void Create (const A &);
};

int main ()
{
  Foo::Create ({{}, {}});
}



g++ -std=c++11 -c t.cc
t.cc: In function 'int main()':
t.cc:13:24: error: no matching function for call to
'Foo::Create(<brace-enclosed initializer list>)'
   Foo::Create ({{}, {}});
                        ^
t.cc:13:24: note: candidate is:
t.cc:8:15: note: static void Foo::Create(const Foo::A&)
   static void Create (const A &);
               ^
t.cc:8:15: note:   no known conversion for argument 1 from '<brace-enclosed
initializer list>' to 'const Foo::A&'

Compiles with Clang and gcc-4.8.

Google ref: b/15094102

Reply via email to