asutton/clang

Injecting members with metaclass names does not work

asutton opened this issue · 1 comments

Consider:

$class foo {
  constexpr {
    -> { void f(foo* p) { } }
  }
};

foo bar { };

The current model injects the tokens void f(foo* p) { } into the token stream and then parses them within the context of the prototype bar. This means the name foo will not be parsed correctly.

We need to parse those tokens as if they were injected into foo and then inject the resulting members into bar.

Fixed by rewriting token identifiers from the metaclass name to the destination class name in 49cc260. This is not a sound solution.