Commit 42328048 by Mark Mitchell Committed by Mark Mitchell

decl.c (reshape_init): Tweak handling of character arrays.

	* decl.c (reshape_init): Tweak handling of character arrays.

	* g++.dg/init/array6.C: Add additional tests.

From-SVN: r58363
parent ecef5e87
2002-10-21 Mark Mitchell <mark@codesourcery.com> 2002-10-21 Mark Mitchell <mark@codesourcery.com>
* decl.c (reshape_init): Tweak handling of character arrays.
PR c++/8218 PR c++/8218
* cp-tree.h (lang_type_class): Add contains_empty_class_p. * cp-tree.h (lang_type_class): Add contains_empty_class_p.
(CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro. (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
......
...@@ -7838,7 +7838,7 @@ reshape_init (tree type, tree *initp) ...@@ -7838,7 +7838,7 @@ reshape_init (tree type, tree *initp)
if (TREE_CODE (old_init_value) == STRING_CST if (TREE_CODE (old_init_value) == STRING_CST
&& TREE_CODE (type) == ARRAY_TYPE && TREE_CODE (type) == ARRAY_TYPE
&& char_type_p (TREE_TYPE (type))) && char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type))))
{ {
/* [dcl.init.string] /* [dcl.init.string]
......
2002-10-21 Mark Mitchell <mark@codesourcery.com>
* g++.dg/init/array6.C: Add additional tests.
2002-10-21 Ulrich Weigand <uweigand@de.ibm.com> 2002-10-21 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.dg/weak/typeof-2.c: Handle s390x targets as well. * gcc.dg/weak/typeof-2.c: Handle s390x targets as well.
......
// { dg-do compile } // { dg-do compile }
char arr [][4] = { "one", "two" }; char arr [][4] = { "one", "two" };
const char arr2[][4] = { "one", "two" };
signed char arr3[][4] = { "one", "two" };
const unsigned char arr4[][4] = { "one", "two" };
volatile wchar_t arr5[][4] = { L"one", L"two" };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment