Commit d1a27eae by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/88187 (ICE on (invalid) C++ code when compiled with -std=c++17: Segmentation fault)

	PR c++/88187
	* decl.c (grokdeclarator): Don't diagnose deduction guide errors
	if !funcdecl_p.

	* g++.dg/other/pr88187.C: New test.

From-SVN: r266537
parent 08e10724
2018-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88187
* decl.c (grokdeclarator): Don't diagnose deduction guide errors
if !funcdecl_p.
PR c++/88181
* class.c (fixup_attribute_variants): Also propagate TYPE_PACKED
to variants.
......
......@@ -11276,7 +11276,7 @@ grokdeclarator (const cp_declarator *declarator,
if (!tmpl)
if (tree late_auto = type_uses_auto (late_return_type))
tmpl = CLASS_PLACEHOLDER_TEMPLATE (late_auto);
if (tmpl)
if (tmpl && funcdecl_p)
{
if (!dguide_name_p (unqualified_id))
{
......
2018-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88187
* g++.dg/other/pr88187.C: New test.
PR c++/88181
* g++.dg/debug/pr88181.C: New test.
......
// PR c++/88187
// { dg-do compile }
template <int> struct A;
void f (A ()); // { dg-error "variable or field 'f' declared void" "" { target c++14_down } }
// { dg-error "missing template arguments before '\\(' token" "" { target c++14_down } .-1 }
// { dg-error "'auto' parameter not permitted in this context" "" { target c++17 } .-2 }
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