Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injecting members with metaclass names does not work #22

Closed
asutton opened this issue Apr 26, 2017 · 1 comment
Closed

Injecting members with metaclass names does not work #22

asutton opened this issue Apr 26, 2017 · 1 comment
Labels

Comments

@asutton
Copy link
Owner

asutton commented Apr 26, 2017

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.

@asutton
Copy link
Owner Author

asutton commented Apr 26, 2017

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

@asutton asutton closed this as completed Apr 26, 2017
@Jenny-fa Jenny-fa added the bug label Apr 26, 2017
mgehre pushed a commit to mgehre/clang-meta that referenced this issue Sep 12, 2018
This change is a prerequisite for a lot of features like proper
post-condition violations and aggregate support. Implementing this also
showed us references are special and they need a lot of
workaround/special casing. It would be great to somehow abstract away
from them.

Calculating the type of a variable is no longer that cheap, maybe it
would be worth to store an always up to date version?

That way we could also make this and temporary variables typed in
the representation.

This fixes asutton#22.

(cherry picked from commit 5e624a8b736d8ec12b856e6508155368960e2aab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants