This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 58888


Hi,

here we reject the declaration of b with the invalid use of ‘auto’ error. The reason is that, at the beginning of grokfield, init != NULL_TREE, processing_template_decl is false (in fact, a "templatized" version of the testcase is accepted) and we get to:

if (TREE_CODE (init) == CONSTRUCTOR)
init = digest_init (TREE_TYPE (value), init, tf_warning_or_error);

then, at the beginning of digest_init_r, complete_type_or_maybe_complain finds the auto type incomplete. It seems to me that in grokfield, in the non-template case too, we should just process the declaration later, in the final switch, thus forward to finish_static_data_member_decl (then the only difference with the "templatized" case that we already handle correctly, is that we don't call push_template_decl in the middle)

Tested x86_64-linux.

Thanks,
Paolo.

////////////////////

Attachment: CL_58888
Description: Text document

Attachment: patch_58888
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]