This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54165] Cast to "void" should not implicitly call conversion functions
- From: "ed at catmur dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Aug 2012 15:44:46 +0000
- Subject: [Bug c++/54165] Cast to "void" should not implicitly call conversion functions
- Auto-submitted: auto-generated
- References: <bug-54165-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54165
Ed Catmur <ed at catmur dot co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ed at catmur dot co.uk
--- Comment #1 from Ed Catmur <ed at catmur dot co.uk> 2012-08-03 15:44:46 UTC ---
The standard reads:
12.3.2 Conversion functions [class.conv.fct]
(1) A conversion function is never used to convert a (possibly cv-qualiïed)
object to [...] (possibly cv-qualiïed) void.
116) A conversion to void does not invoke any conversion function (5.2.9).
5.2.9 Static cast [expr.static.cast]
(6) Any expression can be explicitly converted to type cv void, in which case
it becomes a discarded-value expression (Clause 5).