Page MenuHomePhabricator

Fix removal of out-of-line definitions.

Authored by v.g.vassilev on Mar 21 2017, 6:37 AM.




struct MyClass {
  void f() {}
MyClass::f(){} // expected error redefinition of f.

The routine fails to remove the lookup entry is registered in the semantic decl context and not in the primary decl context of the lexical decl context where we currently are trying to remove it from.

Diff Detail

Event Timeline

v.g.vassilev created this revision.Mar 21 2017, 6:37 AM
v.g.vassilev edited the summary of this revision. (Show Details)


Is it possible to test this change?

Not sure, this code is used by external tools. Maybe I could craft an example but it would be very complex, bringing half of the third party tool codebase...

Could use dumpDeclContext() to test?

rsmith accepted this revision.Mar 22 2017, 5:17 PM

The patch itself LGTM. I'd like some test coverage, but if this will be covered by some upcoming interpreter piece and you need this to unblock yourselves, that's good enough for me. In any case, adding a full-blown UnitTest check for this seems like overkill...

This revision is now accepted and ready to land.Mar 22 2017, 5:17 PM
v.g.vassilev closed this revision.Jun 20 2017, 8:01 AM

Landed in r305799. I would like to test it and I think that should be possible as soon as I land some interpreter infrastructure which is on my TODO list.