This is the mail archive of the gcc-bugs@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]

[Bug c++/57788] Waste work in maybe_deduce_size_from_array_init


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57788

--- Comment #1 from Po-Chun Chang <pchang9 at cs dot wisc.edu> ---
(In reply to Po-Chun Chang from comment #0)
> Created attachment 30427 [details]
> Suggested patch
> 
> The problem appears in revision 200588 in version 4.9. I have attached a
> one-line patch that fixes it.
> 
> In method "maybe_deduce_size_from_array_init()" in decl.c, the loop on line
> 4839 should break immediately after "failure" is set to 1. All the
> iterations after "failure" set to 1 do not perform any useful work, at best
> they just set "failure" again to 1.

Actual errors are reported as diagnostic inside the function
check_array_designated_initializer(), so the loop can't break prematurely.


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