aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-07-08 13:37:29 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-07-08 13:37:29 -0400
commit859f6cb4c614aa98677de15733634ea58d03ed87 (patch)
tree4d9c74305b9edaad09487de198586270da827df3
parent0094f21b6186ed0ba4d580889164fb7ffd15b51f (diff)
downloadgcc-859f6cb4c614aa98677de15733634ea58d03ed87.zip
gcc-859f6cb4c614aa98677de15733634ea58d03ed87.tar.gz
gcc-859f6cb4c614aa98677de15733634ea58d03ed87.tar.bz2
typeck.c (cp_apply_type_quals_to_decl): Don't check COMPLETE_TYPE_P either.
* typeck.c (cp_apply_type_quals_to_decl): Don't check COMPLETE_TYPE_P either. From-SVN: r176052
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/typeck.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 469e6cb..092e5c0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index f0d68c3..5febff5 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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);