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

[namespace.udecl]/17 Fix the note and comment to better reflect that … #749

Closed

Conversation

faisalv
Copy link
Contributor

@faisalv faisalv commented Jun 11, 2016

…while using declarations can aid in resolving certain member-lookup ambiguities, they are not always sufficient.

I admittedly got a little carried away by my prior attempt at this - hopefully this one is more restrained (pls let me know if the comment is still too wordy, and whether you want me to truncate it further or have suggestions)

2016-06-11 10_25_51-f__c -draft_draft_source_declarations tex - texstudio

…while using declarations can aid in resolving certain member-lookup ambiguities, they are not always sufficient.

void f(D* d) {
d->x(); // ambiguous: selected overload \tcode{x()} from the result of name lookup of \tcode{x} in implicit naming class \tcode{D}
// (i.e. \{A::x(), C::x(int), D::x(double)\}) is a direct member of class \tcode{A} which is an ambiguous base
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions:

  1. Every x() should probably just be x -- distinguish the name from the call expression. This example is about names.
  2. Make each term inside the braces appear in code font, e.g. \tcode{A::x} etc.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 13, 2016

(@faisalv: Squash and force-push?)

return d->x(); // ambiguous: \tcode{B::x} or \tcode{C::x}

void f(D* d) {
d->x(); // ambiguous: while member lookup of \tcode{x} in implicit naming class \tcode{D} is unambiguous, the selected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true regardless of the presence or absence of the _using-declaration_s in this example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the using declaration simply helps to guide member lookup so that x() is not hidden.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 18, 2016

@zygoloid, @faisalv: can you two figure out what to do with this PR?

@jensmaurer
Copy link
Member

@faisalv: Please rebase.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 15, 2016

@jensmaurer: This has been stuck for a long time. Could you perhaps take an unbiased look and check whether a) the original problem is actually bad, and b) if yes, perhaps draft some alternative wording that we could use instead?

@jensmaurer
Copy link
Member

It seems to me what we really want to say here is that the using-declaration does help with name lookup issues, but doesn't help with the ambiguous base class conversion (from D to A). See pull request #1254.

@jensmaurer jensmaurer closed this Dec 15, 2016
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

Successfully merging this pull request may close these issues.

None yet

4 participants