[LLVMbugs] [Bug 8373] New: diagnose use of base member before base is initialized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 13 16:20:43 PDT 2010


           Summary: diagnose use of base member before base is initialized
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Created an attachment (id=5616)
 --> (http://llvm.org/bugs/attachment.cgi?id=5616)
full program testcase

The attached testcase is a fully executable version of this snippet:

  struct Base {
    explicit Base(int) { }
    int member_;
  struct Derived : public Base {
    Derived() : Base(member_) { }

I think there should be a warning on use of member_ in Derived because it
hasn't been initialized yet. None of clang, gcc nor EDG warn on this.

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