[LLVMbugs] [Bug 24260] New: point to the destructor that's private or inaccessible

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 24 16:03:39 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24260

            Bug ID: 24260
           Summary: point to the destructor that's private or inaccessible
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Missing note at declaration of private or inaccessible destructor that causes
another type to have no destructor.

$ cat b17589480.cc 
class X {
  ~X();  // private
};
struct Y {
  X x;
};
void test() {
  Y y;
}
$ clang -std=c++14 b17589480.cc 
b17589480.cc:8:5: error: call to implicitly-deleted default constructor of 'Y'
  Y y;
    ^
b17589480.cc:5:5: note: default constructor of 'Y' is implicitly deleted
because
      field 'x' has an inaccessible destructor
  X x;
    ^
1 error generated.

Please add a note pointing to ~X() itself. This will especially help for the
case where Y's member isn't just an X but is template typename T.

-- 
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/20150724/9ea6f384/attachment.html>


More information about the llvm-bugs mailing list