typeck.c (cp_apply_type_quals_to_decl): Don't check COMPLETE_TYPE_P either.
authorJason Merrill <jason@redhat.com>
Fri, 8 Jul 2011 17:37:29 +0000 (13:37 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 8 Jul 2011 17:37:29 +0000 (13:37 -0400)
* typeck.c (cp_apply_type_quals_to_decl): Don't check
COMPLETE_TYPE_P either.

From-SVN: r176052

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 469e6cb1a146e541595f5520ad5ec317dc184d62..092e5c01043e668b23589ccc750996bc16f88a5e 100644 (file)
@@ -1,5 +1,8 @@
 2011-07-08  Jason Merrill  <jason@redhat.com>
 
+       * typeck.c (cp_apply_type_quals_to_decl): Don't check
+       COMPLETE_TYPE_P either.
+
        PR c++/49673
        * typeck.c (cp_apply_type_quals_to_decl): Don't check
        TYPE_NEEDS_CONSTRUCTING.
index f0d68c3dca58b7e31b1fc4a36e18f9fb225f4771..5febff5cba91f74299d8ad6212727134c9387a89 100644 (file)
@@ -8130,12 +8130,10 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl)
   /* We used to check TYPE_NEEDS_CONSTRUCTING here, but now a constexpr
      constructor can produce constant init, so rely on cp_finish_decl to
      clear TREE_READONLY if the variable has non-constant init.  */
-  if (/* If the type isn't complete, we don't know yet if it will need
-        constructing.  */
-      !COMPLETE_TYPE_P (type)
-      /* If the type has a mutable component, that component might be
-        modified.  */
-      || TYPE_HAS_MUTABLE_P (type))
+
+  /* If the type has a mutable component, that component might be
+     modified.  */
+  if (TYPE_HAS_MUTABLE_P (type))
     type_quals &= ~TYPE_QUAL_CONST;
 
   c_apply_type_quals_to_decl (type_quals, decl);