------- Comment #2 from hjl dot tools at gmail dot com 2009-05-11 16:27 ------- This patch:
--- cp/decl.c.foo 2009-05-08 13:54:31.000000000 -0700 +++ cp/decl.c 2009-05-11 09:26:21.000000000 -0700 @@ -8065,6 +8065,9 @@ grokdeclarator (const cp_declarator *dec type = cp_build_qualified_type_real (type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl) ? tf_ignore_bad_quals : 0) | tf_warning_or_error)); + /* FIXME: We need TYPE_STUB_DECL to get attributes on TYPE. */ + if (TYPE_STUB_DECL (type) == NULL_TREE) + TYPE_STUB_DECL (type) = typedef_decl; /* We might have ignored or rejected some of the qualifiers. */ type_quals = cp_type_quals (type); seems to work. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40075