This is an archive of the discontinued LLVM Phabricator instance.

Sema: Implement DR244
ClosedPublic

Authored by majnemer on May 1 2014, 12:48 AM.

Details

Summary

Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 9008.May 1 2014, 12:48 AM
majnemer retitled this revision from to Sema: Implement DR244.
majnemer updated this object.
majnemer added reviewers: rsmith, doug.gregor.
majnemer added a subscriber: Unknown Object (MLST).
majnemer updated this revision to Diff 9030.May 1 2014, 11:34 PM

Add a missing expected-no-diagnostics annotation.

rsmith added inline comments.May 20 2014, 6:43 PM
lib/Sema/SemaExprCXX.cpp
136–137 ↗(On Diff #9030)

Please update this to match the standard (in particular, "the second class-name is looked up in the same scope as the first").

161–167 ↗(On Diff #9030)

By a strict reading of the standard, I think:

namespace N {
  struct A {
    struct B {};
  };
  A *a;
  A::B *b;
}
void f() {
  a->N::~A(); // ok
  b->N::A::~B(); // ill-formed, B is *only* looked up in N
}

... but see also core issue 399. I think our behavior here (with your patch) is appropriate for now.

test/CXX/drs/dr2xx.cpp
1016 ↗(On Diff #9030)

Why was this deleted? If we no longer reject this, that's a regression, and we can no longer claim to implement DR298...

majnemer added inline comments.May 20 2014, 11:43 PM
lib/Sema/SemaExprCXX.cpp
136–137 ↗(On Diff #9030)

Done. :)

test/CXX/drs/dr2xx.cpp
1016 ↗(On Diff #9030)

It was deleted because it conflicts with the following line. Not only do we still reject, we provide a superior diagnostic :)

I've updated the test-case so that we test both cases.

majnemer updated this revision to Diff 9651.May 20 2014, 11:48 PM

Address @rsmith's review comments.

rsmith accepted this revision.May 21 2014, 11:33 AM
rsmith edited edge metadata.

Looks great, thanks!

This revision is now accepted and ready to land.May 21 2014, 11:33 AM
majnemer closed this revision.May 21 2014, 1:27 PM
majnemer updated this revision to Diff 9663.

Closed by commit rL209319 (authored by @majnemer).

This fix doesn't seem to be part of clang 3.5, see http://llvm.org/bugs/show_bug.cgi?id=18879

Doesn't seem to be fixed in 3.6, any idea when this gets fixed in master?

This isn't fixed in 3.6.2, any idea when this gets into a release?

This will be in 3.7.

Just tested 3.7.0, this issue is not fixed in this new release of today

This will be in 3.7.

As far as we can tell DR244 is not fixed yet in 3.9.1 so any idea why this review sets it to YES as implemented?