Thanks for the review. Are you OK with un-statitcize DiagnoseAccessPath so that SemaDeclCXX can call it -- or do you prefer to introduce a wrapper?
On Sun, Jul 26, 2015 at 5:01 PM, Richard Smith <rich...@metafoo.co.uk> wrote: > rsmith added inline comments. > > ================ > Comment at: lib/Sema/SemaDeclCXX.cpp:5575-5581 > @@ +5574,9 @@ > + // Explain the reasons of inaccessibility. > + if (Field) { > + if (CXXRecordDecl *C = Field->getType()->getAsCXXRecordDecl()) { > + CXXDestructorDecl *D = S.LookupDestructor(C); > + if (D && !D->isImplicit()) > + S.Diag(D->getLocStart(), diag::note_destructor_here); > + } > + } > + } > ---------------- > This doesn't seem right: you're producing a note for a destructor no matter > which special member function was found to be inaccessible. The best thing to > do would be to ask the SemaAccess code to produce the relevant note (see > DiagnoseAccessPath); that way you can produce a note that says "declared > private here" or whatever else is relevant (which can sometimes be that a > virtual base destructor is inaccessible due to a private access path, for > instance). > > > Repository: > rL LLVM > > http://reviews.llvm.org/D11517 > > > _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits