public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60135] New: add option to warn if ctor/conversion declared implicit
@ 2014-02-10 16:29 mw_triad at users dot sourceforge.net
0 siblings, 0 replies; only message in thread
From: mw_triad at users dot sourceforge.net @ 2014-02-10 16:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60135
Bug ID: 60135
Summary: add option to warn if ctor/conversion declared
implicit
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mw_triad at users dot sourceforge.net
"explicit" is a great tool for avoiding mistakes in the use of a class.
Unfortunately, programmers must remember to use it, and there is not presently
a mechanism to diagnose failure to do so.
I would like to request that g++ add (1) a warning if a constructor or
conversion operator is not declared "explicit", and (2) some mechanism (e.g. an
attribute) to silence this warning for a particular declaration, i.e. to
annotate that a constructor or conversion operator is intended to be implicit.
This would help to prevent forgetting to make such "explicit" when implicit
behavior is not desired.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-10 16:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10 16:29 [Bug c++/60135] New: add option to warn if ctor/conversion declared implicit mw_triad at users dot sourceforge.net
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).