[LLVMbugs] [Bug 21021] New: Typo-correct accesses to private members with call to accessor methods

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 21 14:17:06 PDT 2014


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

            Bug ID: 21021
           Summary: Typo-correct accesses to private members with call to
                    accessor methods
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:

class Scan {
  int build_log_;
 public:
  int build_log() const { return build_log_; }
};

int f(const Scan& s) {
  return s.build_log_;
}

Clang currently says 

test.cc:8:12: error: 'build_log_' is a private member of 'Scan'
  return s.build_log_;
           ^
test.cc:2:7: note: implicitly declared private here
  int build_log_;
      ^
1 error generated.


I'd be cool if it'd say something like "did you mean to call the public
accessor build_log()" and offer a typo correction for this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140921/303c32a1/attachment.html>


More information about the llvm-bugs mailing list