summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-25 00:13:45 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-25 00:13:45 +0000
commit8a27e869699b9946b08aa44dd92d5d8b2ad26d27 (patch)
treedf80a5e6a3e2b9311e58c1832f38a21203278e85 /gcc/cp
parentbd54bbc6b07e081013f7996a9239f15f62e7719d (diff)
downloadgcc-8a27e869699b9946b08aa44dd92d5d8b2ad26d27.tar.gz
* typeck.c (build_modify_expr): The pedwarn for array assignment is
now unconditional. * tree.c (build_cplus_array_type_1): Still process simple array types normally in templates. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/tree.c7
-rw-r--r--gcc/cp/typeck.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e4ca0591d51..ef5faf451b0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -19,6 +19,9 @@
PR c++/6331
* method.c (do_build_copy_constructor): Use cp_build_qualified_type.
* typeck.c (build_modify_expr): Allow arrays to differ in cv-quals.
+ The pedwarn for array assignment is now unconditional.
+ * tree.c (build_cplus_array_type_1): Still process simple array types
+ normally in templates.
PR c++/6395
* decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index ff3e633302b..cdf9d7509ba 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -463,7 +463,12 @@ build_cplus_array_type_1 (elt_type, index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- if (processing_template_decl
+ /* Don't do the minimal thing just because processing_template_decl is
+ set; we want to give string constants the right type immediately, so
+ we don't have to fix them up at instantiation time. */
+ if ((processing_template_decl
+ && index_type && TYPE_MAX_VALUE (index_type)
+ && TREE_CODE (TYPE_MAX_VALUE (index_type)) != INTEGER_CST)
|| uses_template_parms (elt_type)
|| uses_template_parms (index_type))
{
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 10db2f84b3a..a1050bb7596 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5674,7 +5674,7 @@ build_modify_expr (lhs, modifycode, rhs)
}
/* Allow array assignment in compiler-generated code. */
- if (pedantic && ! DECL_ARTIFICIAL (current_function_decl))
+ if (! DECL_ARTIFICIAL (current_function_decl))
pedwarn ("ISO C++ forbids assignment of arrays");
from_array = TREE_CODE (TREE_TYPE (newrhs)) == ARRAY_TYPE