Commit 25a34b02 by Marek Polacek Committed by Marek Polacek

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
parent cc770199
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)
......
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
......
// PR c++/88741
template <class T>
void foo()
{
char row[] = {"test"};
}
void bar()
{
foo<int>();
}
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