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

[bad.cast], [bad.exception] nest index entries consistently #744

Merged
merged 1 commit into from Jun 9, 2016

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Jun 9, 2016

This adjusts the index entries for bad_cast::what and bad_exception::what to be nested consistently with bad_alloc::what and bad_array_new_length::what

diff

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

Looks obviously correct to me. Ship it! :-)

@AlisdairM
Copy link
Contributor

I opted not to fix this in my earlier PRs until I figured out how this was trying to hook into the implementation-defined index - which is coming up shortly on my personal todo list.

@zygoloid
Copy link
Member

zygoloid commented Jun 9, 2016

The subitem should be just what, not bad_cast::what / bad_exception::what. As written, this is the index entry for bad_cast::bad_cast::what. We seem to get this wrong for all the what members and nothing else...

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

@zygoloid: True, but at least this PR makes it a bit more consistent. Removing the inner qualification would seem apposite, though.

@zygoloid
Copy link
Member

zygoloid commented Jun 9, 2016

Looks like it's not only the what members; we also get this wrong for ios_base::failure, ios_base::Init, and type_info::name.

@zygoloid zygoloid merged commit 28f8551 into cplusplus:master Jun 9, 2016
@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

Are you thinking that all members, whether they're functions or types, should just have an unqualified index entry nested under their containing class? I guess for ios_base::* we could just remove the "constructor", "destructor" entries and only have the item itself.

@zygoloid
Copy link
Member

zygoloid commented Jun 9, 2016

I've made some cleanups in 6d3936c.

The approach I took is that class member, irrespective of type, should be listed under the name of its class (the qualified name if it's a nested class)

So we have an Init and a failure under ios_base, but the members of those types are listed under separate top-level ios_base::Init and ios_base::failure index entries:

screenshot from 2016-06-09 14 35 02

I'm not sure whether we can do better than this, thoughts appreciated.

Part of the point of the library index is to indicate which names are reserved (that is, names the program can't #define before including a library header), so each name that's used should also be listed as a top-level entry; this means we'd end up with all of "failure, ios_base", "ios_base, failure", and "ios_base::failure" in the index. I'm in two minds as to whether that's excessive.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

I'm thinking "excessive"...

That said, maybe the nested entries like "ios_base, failure" should say "see: ios_base::failure".

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

That said, we do have an index entry for what, so perhaps we also should have one for failure.

@AlisdairM
Copy link
Contributor

what is a virtual function defined for many classes, while failure is a nested class with its own members. The nesting in the index indicates something quite different in these cases (and is common throughout the index).

I think that Richard has the right shape above - that I what I was trying to achieve in my recent clean-up of the constructors when I fell into this hole. The additional unqualified entries sound excessive to me, but then, I don't use the index as a means to find the reserved library names, so excessive may be the right answer - in which case I like Thomas 'see xxx' solution.

@jwakely
Copy link
Member Author

jwakely commented Jun 10, 2016

I've made some cleanups in 6d3936c.

Even better.

FrankHB pushed a commit to FrankHB/draft that referenced this pull request Jul 9, 2016
@jwakely jwakely deleted the nesting-what-functions branch November 23, 2017 20:12
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