Skip to content

The name of a variable of type "pointer to member" is misplaced #279

@languagelawyer

Description

@languagelawyer

For the code

struct S { void f(); };

int main()
{
    auto p = &S::f;
}

cppinsights produces

struct S
{
  void f();
  
};



int main()
{
  void (S::*)() p = &S::f;
}

while it should have produced

struct S
{
  void f();
  
};



int main()
{
  void (S::*p)() = &S::f;
}

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