This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, c] PR c/48956: diagnostics for conversions involving complex types


On Mon, 29 Dec 2014, Mikhail Maltsev wrote:

> diff --git a/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c b/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
> new file mode 100644
> index 0000000..b1aaf54
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
> @@ -0,0 +1,139 @@
> +/* PR c/48956: Test for diagnostics for implicit conversions from complex
> +   to real types and narrowing conversions of complex types.  */
> +
> +/* Architecture restrictions taken from Wconversion-real-integer.c.
> +   Likewise, the magic value 16777217.  */
> +
> +/* { dg-do compile } */
> +/* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */
> +/* { dg-options " -std=c99 -pedantic -Wconversion " } */
> +/* { dg-require-effective-target int32plus } */
> +/* { dg-require-effective-target double64plus } */
> +/* { dg-require-effective-target int32plus } */

"dg-require-effective-target int32plus" is only needed once, not twice.

> +#if 0
> +  /* Check needs to be implemented.  */
> +  fuic (-1. + 0.i);
> +  vuic = -1. + 0.i;
> +#endif

The #if 0 cases should have a bug filed in Bugzilla to track that certain 
checks aren't implemented.

The patch is OK for GCC 6 with the above fix and such a bug filed, once 
the copyright assignment is in place.  (Once GCC 5 has branched and the 
assignment is done, please retest and send a patch with the testcase fix 
to gcc-patches with a request for someone to commit it.)

http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future

if you haven't yet started the assignment process.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]