re PR c++/58705 ([c++11] ICE with invalid initializer for _Complex variable)
PR c++/58705 cp/ * typeck2.c (check_narrowing): Don't check narrowing when the scalar initializer is empty. testsuite/ * g++.dg/parse/pr58705.C: New test. From-SVN: r204014
This commit is contained in:
parent
8e701300d2
commit
320a9762ee
@ -1,3 +1,9 @@
|
||||
2013-10-24 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/58705
|
||||
* typeck2.c (check_narrowing): Don't check narrowing when the scalar
|
||||
initializer is empty.
|
||||
|
||||
2013-10-23 Jason Merrill <jason@redhat.com>
|
||||
|
||||
LWG 2165
|
||||
|
@ -834,7 +834,8 @@ check_narrowing (tree type, tree init)
|
||||
&& TREE_CODE (type) == COMPLEX_TYPE)
|
||||
{
|
||||
tree elttype = TREE_TYPE (type);
|
||||
check_narrowing (elttype, CONSTRUCTOR_ELT (init, 0)->value);
|
||||
if (CONSTRUCTOR_NELTS (init) > 0)
|
||||
check_narrowing (elttype, CONSTRUCTOR_ELT (init, 0)->value);
|
||||
if (CONSTRUCTOR_NELTS (init) > 1)
|
||||
check_narrowing (elttype, CONSTRUCTOR_ELT (init, 1)->value);
|
||||
return;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2013-10-24 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/58705
|
||||
* g++.dg/parse/pr58705.C: New test.
|
||||
|
||||
2013-10-24 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* gcc.dg/c11-align-5.c: Add more testing.
|
||||
|
5
gcc/testsuite/g++.dg/parse/pr58705.C
Normal file
5
gcc/testsuite/g++.dg/parse/pr58705.C
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/58705
|
||||
// { dg-do compile }
|
||||
// { dg-options "-Wnarrowing" }
|
||||
|
||||
_Complex float f = {{}};
|
Loading…
x
Reference in New Issue
Block a user