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] Fix PR58705


On 10/14/2013 08:23 AM, Marek Polacek wrote:
We were ICEing on the attached testcase, because in check_narrowing,
for = {{}}, we wanted to check recursively the CONSTRUCTOR_ELTs,
even though init in this case has 0 CONSTRUCTOR_NELTS.  So I added
the check for CONSTRUCTOR_NELTS > 0.  Moreover, since empty scalar
initializers are forbidden in C FE, I think we should error out here
too.  (Complex type is considered as an arithmetic type as a GNU
extension and arithmetic types are scalar types.)

Empty scalar initializers are allowed in C++11, so we shouldn't give an error. Your initial patch from bugzilla is OK, with an appropriately adjusted testcase.

Jason


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