[LLVMbugs] [Bug 7288] New: Fixit for missing & before member-pointer expression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 2 23:06:12 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7288

           Summary: Fixit for missing & before member-pointer expression
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: quality-of-implementation
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jyasskin at google.com
                CC: chandlerc at gmail.com, llvmbugs at cs.uiuc.edu,
                    dgregor at apple.com


$ cat test.cc
struct Foo {
  int square(int i);
};

void TakeMemberPointer(Foo&, int(Foo::*)(int));

void Use() {
  Foo f;
  TakeMemberPointer(f, Foo::square);
}
$ clang++ -fsyntax-only test.cc
test.cc:9:29: error: call to non-static member function without an object
argument
  TakeMemberPointer(f, Foo::square);
                       ~~~~~^~~~~~
1 error generated.
$

Instead of assuming that's going to be a call, clang should recognize that it's
intended to be a member-function-pointer expression and give a fixit to add the
'&'.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list