Commit df23ba64 by Jason Merrill Committed by Jason Merrill

re PR c++/46005 ([C++0x] Don't allow "auto" as the simple-type-specifier of a typedef)

	PR c++/46145
	* decl.c (grokdeclarator): Complain about auto typedef.

From-SVN: r174228
parent ce9b1898
2011-05-25 Jason Merrill <jason@redhat.com>
PR c++/46145
* decl.c (grokdeclarator): Complain about auto typedef.
PR c++/46245
* decl.c (grokdeclarator): Complain later for auto parameter.
* pt.c (splice_late_return_type): Handle use in a template
......
......@@ -9481,6 +9481,12 @@ grokdeclarator (const cp_declarator *declarator,
memfn_quals = TYPE_UNQUALIFIED;
}
if (type_uses_auto (type))
{
error ("typedef declared %<auto%>");
type = error_mark_node;
}
if (decl_context == FIELD)
decl = build_lang_decl (TYPE_DECL, unqualified_id, type);
else
......
2011-05-25 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/auto9.C: Add typedef test.
* g++.dg/cpp0x/auto23.C: New.
* g++.dg/cpp0x/auto9.C: Adjust.
......
......@@ -119,3 +119,6 @@ H<auto> h; // { dg-error "invalid" }
void qq (auto); // { dg-error "auto" }
void qr (auto*); // { dg-error "auto" }
// PR c++/46145
typedef auto autot; // { dg-error "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