mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 09:58:59 +08:00
typeck.c (build_modify_expr): The pedwarn for array assignment is now unconditional.
* 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. From-SVN: r52746
This commit is contained in:
parent
fcae219ac4
commit
a49cfba81b
@ -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
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -1,7 +1,6 @@
|
||||
// 981203 bkoz
|
||||
// g++/14664 - test
|
||||
// Build don't link:
|
||||
// Special g++ Options: -fconst-strings
|
||||
|
||||
char foo[26];
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 981203 bkoz
|
||||
// g++/14664 + test
|
||||
// Build don't link:
|
||||
// Special g++ Options: -fno-const-strings
|
||||
// Special g++ Options: -fpermissive -w
|
||||
|
||||
char foo[26];
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Build don't link:
|
||||
// Special g++ Options: -fno-const-strings
|
||||
// Special g++ Options: -fpermissive -w
|
||||
// Origin: Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
char foo[26];
|
||||
|
Loading…
Reference in New Issue
Block a user