r231451 - Don't crash on non-public referenced dtors in toplevel classes.

Nico Weber thakis at chromium.org
Tue Apr 14 08:56:46 PDT 2015


On Tue, Apr 14, 2015 at 7:25 AM, Tom Stellard <tom at stellard.net> wrote:

> Hi,
>
> This patch hasn't been merged to the 3.6 branch yet.  I attempted to
> merge this, but there was a merge conflict.  I was investigating the
> conflict, and it seems like we should merge r227073 too
> (http://llvm.org/viewvc/llvm-project?view=revision&revision=227073).
>
> What does everyone think?  Is this patch safe to merge too?
>

I'm not aware of problems with it. It does change what clang accepts (it
gets more permissive), so maybe it's out of scope for a point release
because of that?

Resolving the conflict shouldn't be too hard – it's just that lines close
to each other were touched in these two patches, not the same lines, right?


>
> -Tom
>
> On Fri, Mar 06, 2015 at 06:30:57PM -0800, Richard Smith wrote:
> > On Fri, Mar 6, 2015 at 6:00 PM, Tom Stellard <tom at stellard.net> wrote:
> >
> > > On Fri, Mar 06, 2015 at 11:50:51AM -0800, Hans Wennborg wrote:
> > > > Tom, is this OK for 3.6.1?
> > > >
> > >
> > > This is fine with me as long as Richard approves.
> >
> >
> > LGTM for 3.6.1.
> >
> >
> > >
> > > -Tom
> > >
> > > > On Thu, Mar 5, 2015 at 10:01 PM, Nico Weber <nicolasweber at gmx.de>
> wrote:
> > > > > Author: nico
> > > > > Date: Fri Mar  6 00:01:06 2015
> > > > > New Revision: 231451
> > > > >
> > > > > URL: http://llvm.org/viewvc/llvm-project?rev=231451&view=rev
> > > > > Log:
> > > > > Don't crash on non-public referenced dtors in toplevel classes.
> > > > >
> > > > > Fixes PR22793, a bug that caused self-hosting to fail after the
> > > innocuous
> > > > > r231254. See the bug for details.
> > > > >
> > > > > Modified:
> > > > >     cfe/trunk/lib/Sema/SemaExpr.cpp
> > > > >     cfe/trunk/test/CodeGenCXX/trivial-constructor-init.cpp
> > > > >
> > > > > Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> > > > > URL:
> > >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=231451&r1=231450&r2=231451&view=diff
> > > > >
> > >
> ==============================================================================
> > > > > --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> > > > > +++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Mar  6 00:01:06 2015
> > > > > @@ -117,7 +117,7 @@ static AvailabilityResult DiagnoseAvaila
> > > > >      case AR_Available:
> > > > >      case AR_NotYetIntroduced:
> > > > >        break;
> > > > > -
> > > > > +
> > > > >      case AR_Deprecated:
> > > > >        if (S.getCurContextAvailability() != AR_Deprecated)
> > > > >          S.EmitAvailabilityWarning(Sema::AD_Deprecation,
> > > > > @@ -11859,8 +11859,11 @@ void Sema::MarkFunctionReferenced(Source
> > > > >    } else if (CXXDestructorDecl *Destructor =
> > > > >                   dyn_cast<CXXDestructorDecl>(Func)) {
> > > > >      Destructor =
> cast<CXXDestructorDecl>(Destructor->getFirstDecl());
> > > > > -    if (Destructor->isDefaulted() && !Destructor->isDeleted())
> > > > > +    if (Destructor->isDefaulted() && !Destructor->isDeleted()) {
> > > > > +      if (Destructor->isTrivial() &&
> > > !Destructor->hasAttr<DLLExportAttr>())
> > > > > +        return;
> > > > >        DefineImplicitDestructor(Loc, Destructor);
> > > > > +    }
> > > > >      if (Destructor->isVirtual() && getLangOpts().AppleKext)
> > > > >        MarkVTableUsed(Loc, Destructor->getParent());
> > > > >    } else if (CXXMethodDecl *MethodDecl =
> > > dyn_cast<CXXMethodDecl>(Func)) {
> > > > >
> > > > > Modified: cfe/trunk/test/CodeGenCXX/trivial-constructor-init.cpp
> > > > > URL:
> > >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/trivial-constructor-init.cpp?rev=231451&r1=231450&r2=231451&view=diff
> > > > >
> > >
> ==============================================================================
> > > > > --- cfe/trunk/test/CodeGenCXX/trivial-constructor-init.cpp
> (original)
> > > > > +++ cfe/trunk/test/CodeGenCXX/trivial-constructor-init.cpp Fri
> Mar  6
> > > 00:01:06 2015
> > > > > @@ -32,3 +32,17 @@ static C c[4];
> > > > >
> > > > >  int main() {
> > > > >  }
> > > > > +
> > > > > +namespace PR22793 {
> > > > > +template <typename>
> > > > > +struct foo {
> > > > > +protected:
> > > > > +// CHECK-NOT: _ZN7PR227933fooIiED2Ev
> > > > > +  ~foo() = default;
> > > > > +  friend void func();
> > > > > +};
> > > > > +
> > > > > +void func() { foo<int> f; }
> > > > > +
> > > > > +template struct foo<int>;
> > > > > +}
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > cfe-commits mailing list
> > > > > cfe-commits at cs.uiuc.edu
> > > > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> > >
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150414/d955bd93/attachment.html>


More information about the cfe-commits mailing list