Skip to content
  • Francois Ferrand's avatar
    C++: fix constructor definition parsing. · 5e8c3f4b
    Francois Ferrand authored
    
    
    When a constructor is defined with a single, unnamed argument of a custom type without
    extra type specifiers (const...), then the constructor was not identified as such.
    There was an heuristic in case the constructor was in the class definition, but not if the
    the constructor was defined later.
    
    Examples:
    
    class Arg;
    class Other;
    
    class Foo {
      Foo(Arg /*arg*/);               // working
      Foo(const Arg /*arg*/);         // working
      Foo(int /*arg*/);               // working
      Foo(Other /*arg*/)         {}   // working
    };
    
    Foo::Foo(Arg /*arg*/)        {}   // used not to work, fixed
    Foo::Foo(Arg arg){}               // working
    Foo::Foo(const Arg /*arg*/)  {}   // working
    Foo::Foo(int arg)            {}   // working
    
    Change-Id: I741e4ba62672ddc99a837fdcdc27996fba5ae6c7
    Reviewed-by: default avatarhjk <qthjk@ovi.com>
    5e8c3f4b