[Bug c++/7614] Warning when function returning reference to volatile called in void context

timb at bluearc dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 26 11:02:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7614


timb at bluearc dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


------- Additional Comments From timb at bluearc dot com  2003-08-26 11:02 -------
Can I ask you to reconsider? The usual assignment operator idiom requires
returning a reference. Of course, it's perfectly possible to write volatile
assignment operators to return void, but that's not the expected semantics.

The return statement in the function definition doesn't generate any warning
(and even if it did, explicitly casting to reference wouldn't be too onerous),
but every call of the function does, and it can begin to drown out the rest of
the output. Even if you decide to keep the warning, an option to disable it
would be nice.



More information about the Gcc-bugs mailing list