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

UARTSerial: Avoid readable() ambiguity #5066

Merged
merged 1 commit into from Sep 28, 2017

Conversation

Projects
None yet
5 participants
@kjbracey-arm
Contributor

kjbracey-arm 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

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:uartserial_readable branch Sep 11, 2017

@geky

geky approved these changes Sep 11, 2017

@geky

This comment has been minimized.

Member

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.

😆

drivers/UARTSerial.h Outdated
@@ -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 */

This comment has been minimized.

@geky

geky Sep 11, 2017

Member

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

This comment has been minimized.

@kjbracey-arm

kjbracey-arm Sep 12, 2017

Contributor

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: Avoid readable() ambiguity
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.

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:uartserial_readable branch to 3b9f9bb Sep 12, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 28, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 28, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1422

All builds and test passed!

@theotherjimmy theotherjimmy merged commit f7cca5b into ARMmbed:master Sep 28, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment