[LLVMbugs] [Bug 15045] New: "member reference type 'Cl0' is not a pointer" diag should have a fixit to change '->' to '.'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 22 13:34:18 PST 2013


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

             Bug #: 15045
           Summary: "member reference type 'Cl0' is not a pointer" diag
                    should have a fixit to change '->' to '.'
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This works as expected to change '.' into '->':

67-218-106-39:clang thakis$ cat foo.cc
class Cl0 {
public:
  int a;
};

int f() {
  Cl0* c;
  return c.a;
}
67-218-106-39:clang thakis$ ../../Release+Asserts/bin/clang -c foo.cc
foo.cc:8:11: error: member reference type 'Cl0 *' is a pointer; maybe you meant
to use '->'?
  return c.a;
         ~^
          ->
1 error generated.



The reverse case doesn't have the fixit for some reason, but should:

67-218-106-39:clang thakis$ cat foo.cc
class Cl0 {
public:
  int a;
};

int f() {
  Cl0 c;
  return c->a;
}
67-218-106-39:clang thakis$ ../../Release+Asserts/bin/clang -c foo.cc
foo.cc:8:11: error: member reference type 'Cl0' is not a pointer
  return c->a;
         ~^
1 error generated.

-- 
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