This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Disallow Base to Derived conversions for catching pointers to members.
ClosedPublic

Authored by EricWF on Apr 6 2015, 11:03 AM.

Details

Summary

I accidentally implemented the 4.11 [conv.mem] conversions for libc++abi in a recent patch. @majnemer pointed out that 5.13 [except.handle] only allows the pointer conversions in 4.10 and not those is 4.11. This patch no longer allows the following example code:

c++
struct A {};
struct B : public A {};

int main() {
  try {
    throw (int A::*)0;
  } catch (int B::*) {
    // exception caught here.
  }
}

Diff Detail

Event Timeline

EricWF updated this revision to Diff 23284.Apr 6 2015, 11:03 AM
EricWF retitled this revision from to [libcxxabi] Disallow Base to Derived conversions for catching pointers to members..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, jroelofs, majnemer.
EricWF added subscribers: Unknown Object (MLST), majnemer.
majnemer accepted this revision.Apr 6 2015, 3:50 PM
majnemer edited edge metadata.

LGTM, thanks for fixing this!

This revision is now accepted and ready to land.Apr 6 2015, 3:50 PM
EricWF closed this revision.Apr 6 2015, 4:05 PM