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

Tuple expansion bug #28

Open
asutton opened this issue Jul 11, 2017 · 0 comments
Open

Tuple expansion bug #28

asutton opened this issue Jul 11, 2017 · 0 comments

Comments

@asutton
Copy link
Owner

asutton commented Jul 11, 2017

There appears to be a bug in the instantiation of loop bodies involving the members of a class. From the literal value test:

$class literal_value {
  // Transform members
  constexpr {
    access_kind mode = default_access;
    for... (auto m : $literal_value.members()) { // NOTE: members
      if (mode == default_access) {
        if constexpr (m.is_member_variable()) {
          m.make_private();
        }
        
        if constexpr (m.is_member_function()) {
          m.make_public();
          m.make_constexpr();
        }
        
        if constexpr (m.is_access_specifier())
          mode = m.access();
      }
    }
  } // end metaprogram
}

When the loop is expanded, the conditions appear to be discarded in each block -- they are essentially empty if statements. However, if I change the range variable to e.g., member_functions, the body of the loop is correctly expanded.

It seems like the first expansion of the loop is determining the properties for all subsequent expansions. This could be an artifact of metaclass application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant