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]

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")


Hi,

On 19/05/2016 15:58, Jason Merrill wrote:
On 05/18/2016 07:13 PM, Paolo Carlini wrote:
+      error ("cannot declare variable %q+D with function type", decl);

I think the error message would be more helpful if it mentioned decltype(auto), maybe

"initializer for %<decltype(auto) %D%> has function type, did you forget the %<()%>?", DECL_NAME (decl)

(or some other way to print the variable type as declared rather than as deduced).

The below passes testing. There are a few minor changes wrt your suggestions (I think we want & as hint; spacing consistent with typeck2.c; DECL_NAME doesn't seem necessary). I wondered if we want to tighten the condition consistently with the wording of the error message, thus patchlet *2 below, which of course also passes testing.

Thanks,
Paolo.

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

Attachment: patch_70572_3
Description: Text document

Attachment: patch_70572_3b
Description: Text document


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