* c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
authorMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 19 May 2015 20:08:21 +0000 (20:08 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 19 May 2015 20:08:21 +0000 (20:08 +0000)
From-SVN: r223414

gcc/c/ChangeLog
gcc/c/c-typeck.c

index 390400d79031b1f0cf5b0c04d1784d03b7f5ee5b..4521cd13218afa98d444ef4efa25fe232cf94389 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-19  Marek Polacek  <polacek@redhat.com>
+
+       * c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
+
 2015-05-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/66199
@@ -10,7 +14,7 @@
 2015-05-19  Mikhail Maltsev  <maltsevm@gmail.com>
 
        * c-typeck.c (build_array_ref): Use std::swap instead of explicit
-       swaps
+       swaps.
 
 2015-05-16  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
index 7f544902bb106981cba6844d32c043dc91ebc81e..cf5322f5f21a82e75080ddbed3ecddda844d7006 100644 (file)
@@ -7126,10 +7126,7 @@ start_init (tree decl, tree asmspec_tree ATTRIBUTE_UNUSED, int top_level)
        = ((TREE_STATIC (decl) || (pedantic && !flag_isoc99))
           /* For a scalar, you can always use any value to initialize,
              even within braces.  */
-          && (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
-              || TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
-              || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE
-              || TREE_CODE (TREE_TYPE (decl)) == QUAL_UNION_TYPE));
+          && AGGREGATE_TYPE_P (TREE_TYPE (decl)));
       locus = identifier_to_locale (IDENTIFIER_POINTER (DECL_NAME (decl)));
     }
   else