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.