Skip to content

UARTSerial: Avoid readable() ambiguity #5066

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

Merged
merged 1 commit into from
Sep 28, 2017

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Sep 11, 2017

UARTSerial inherits both FileHandle::readable() [public] and
SerialBase::readable() [private], so calling readable() on a UARTSerial
object produces an ambiguous member error.

Add using declarations to direct towards the FileHandle versions of
readable and writable.

There's currently no ambiguity for writable, as SerialBase uses the
spelling writeable, but add a using directive for that anyway, in case
SerialBase gains writable later.

Resolves issue #5035

@geky
Copy link
Contributor

geky commented Sep 11, 2017

There's currently no ambiguity for writable, as SerialBase uses the
spelling writeable, but add a using directive for that anyway, in case
SerialBase gains writable later.

😆

@@ -56,6 +56,15 @@ class UARTSerial : private SerialBase, public FileHandle, private NonCopyable<UA
*/
virtual short poll(short events) const;

/** Resolve ambiguity versus our private SerialBase */
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I think these shouldn't be doxygen comments (no double asteriks). The inherited function should pop up in the generated doxygen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. A bit of Google suggests doxygen fails to understand using declarations, such that this comment doesn't achieve anything, and if we were using a private function, it wouldn't show up. But in this case it's a public function that was visible anyway.

@geky geky added the needs: CI label Sep 11, 2017
UARTSerial inherits both FileHandle::readable() [public] and
SerialBase::readable() [private], so calling readable() on a UARTSerial
object produces an ambiguous member error.

Add using declarations to direct towards the FileHandle versions of
readable and writable.

There's currently no ambiguity for writable, as SerialBase uses the
spelling 'writeable', but add a using directive for that anyway, in case
SerialBase gains 'writable' later.
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 28, 2017

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1422

All builds and test passed!

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

Successfully merging this pull request may close these issues.

5 participants