Add -Wclass-conversion.
authorMarek Polacek <polacek@redhat.com>
Thu, 20 Sep 2018 01:56:58 +0000 (01:56 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 20 Sep 2018 01:56:58 +0000 (01:56 +0000)
commita599af84b2170d8d66385674ef59283ac7567beb
treebf068ca7002b41bbcd5a22acbec77ab45d67f0ac
parentcf16d179d570e9a5535267b92e0f9e71756483b0
Add -Wclass-conversion.

* c.opt (Wclass-conversion): New.

* decl.c (grok_op_properties): Change a warning from -Wconversion to
-Wclass-conversion.  Make it print the types.

* doc/invoke.texi: Document -Wclass-conversion.

* g++.dg/conversion/op4.C: Add dg-warning.
* g++.dg/warn/Wclass-conversion1.C: New test.
* g++.dg/warn/Wclass-conversion2.C: New test.
* g++.dg/warn/Wconversion5.C: Remove file.
* g++.dg/warn/conversion-function-1.C: Use -Wno-class-converison.
* g++.old-deja/g++.bugs/900215_01.C: Adjust dg-warning.
* g++.old-deja/g++.jason/conversion5.C: Likewise.

From-SVN: r264438
14 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/conversion/op4.C
gcc/testsuite/g++.dg/warn/Wclass-conversion1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wclass-conversion2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wconversion5.C [deleted file]
gcc/testsuite/g++.dg/warn/conversion-function-1.C
gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
gcc/testsuite/g++.old-deja/g++.jason/conversion5.C