Commit 27a98312 by Marek Polacek Committed by Marek Polacek

re PR c++/86915 (Segmentation fault for an array of auto in template parameter)

	PR c++/86915
	* decl.c (create_array_type_for_decl): Handle null name.

	* g++.dg/diagnostic/auto1.C: New test.

From-SVN: r263507
parent 116c7f32
2018-08-13 Marek Polacek <polacek@redhat.com>
PR c++/86915
* decl.c (create_array_type_for_decl): Handle null name.
2018-08-10 Jason Merrill <jason@redhat.com>
PR c++/86728 - C variadic generic lambda.
......
......@@ -9838,7 +9838,10 @@ create_array_type_for_decl (tree name, tree type, tree size)
type-specifier, the program is ill-formed. */
if (type_uses_auto (type))
{
error ("%qD declared as array of %qT", name, type);
if (name)
error ("%qD declared as array of %qT", name, type);
else
error ("creating array of %qT", type);
return error_mark_node;
}
......
2018-08-13 Marek Polacek <polacek@redhat.com>
PR c++/86915
* g++.dg/diagnostic/auto1.C: New test.
2018-08-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/66679
......
// PR c++/86915
// { dg-do compile { target c++17 } }
template<auto [1]> struct S; // { dg-error "creating array of .auto." }
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