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

[expr.prim.id.unqual] Fix cross reference #2232

Closed
wants to merge 1 commit into from

Conversation

cpplearner
Copy link
Contributor

No description provided.

@cpplearner
Copy link
Contributor Author

BTW, since it's possible to have a qualified-id that names a bit-field, should a similar note be added to [expr.prim.id.qual]?

struct A {
    int x : 1;
    void f();
};
namespace N {
    auto [b] = A{};
}
void A::f() {
    A::x; // bit-field
    N::b; // bit-field
}

@jensmaurer
Copy link
Member

Regarding the original issue: I'd like to keep the cross-reference as-is to highlight that structured bindings could also refer to a bit-field. If you want to add a cross-reference to class.bit, do so on the first mention of bit-field in the sentence (a little earlier).

Regarding your second point: Agreed, but make that a second pull request, because it actually adds normative wording, which might cause more resistance.

@cpplearner
Copy link
Contributor Author

  1. I think structured binding should be explicitly mentioned earlier in this sentence, and it feels redundant if the same cross reference appears twice in this sentence, i.e.

The expression is an lvalue if the entity is a function, variable, structured binding\iref{dcl.struct.bind}, data member, or template parameter object and a prvalue otherwise\iref{basic.lval}; it is a bit-field if the identifier designates a bit-field\iref{dcl.struct.bind}.

(I'll send another PR for this change.)

  1. I'm not sure where to put the rule on bit-field. Maybe instead of adding it to [expr.prim.id.qual], it's better to move the rule to [expr.prim.id], to avoid repetition?

@zygoloid zygoloid added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jul 2, 2018
@cpplearner cpplearner closed this Jul 2, 2018
@cpplearner cpplearner deleted the patch-1 branch October 12, 2018 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants