mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-10 22:57:27 +08:00
PR c++/88741 - wrong error with initializer-string.
* decl.c (cp_complete_array_type): Strip any location wrappers. * g++.dg/init/array50.C: New test. From-SVN: r267656
This commit is contained in:
parent
cc770199de
commit
25a34b0236
@ -1,3 +1,8 @@
|
||||
2019-01-07 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/88741 - wrong error with initializer-string.
|
||||
* decl.c (cp_complete_array_type): Strip any location wrappers.
|
||||
|
||||
2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||
|
||||
PR c++/88261
|
||||
|
@ -8433,6 +8433,7 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
|
||||
{
|
||||
vec<constructor_elt, va_gc> *v = CONSTRUCTOR_ELTS (initial_value);
|
||||
tree value = (*v)[0].value;
|
||||
STRIP_ANY_LOCATION_WRAPPER (value);
|
||||
|
||||
if (TREE_CODE (value) == STRING_CST
|
||||
&& v->length () == 1)
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-01-07 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/88741 - wrong error with initializer-string.
|
||||
* g++.dg/init/array50.C: New test.
|
||||
|
||||
2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||
|
||||
PR c++/88261
|
||||
|
12
gcc/testsuite/g++.dg/init/array50.C
Normal file
12
gcc/testsuite/g++.dg/init/array50.C
Normal file
@ -0,0 +1,12 @@
|
||||
// PR c++/88741
|
||||
|
||||
template <class T>
|
||||
void foo()
|
||||
{
|
||||
char row[] = {"test"};
|
||||
}
|
||||
|
||||
void bar()
|
||||
{
|
||||
foo<int>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user