[PATCH] Make C++ use the enum mode attribute
Bernd Edlinger
bernd.edlinger@hotmail.de
Sat Feb 6 20:36:00 GMT 2016
Hi Jakub,
as a follow-up for your c/69669 fix, I'd like to have the enum mode also honored
in C++ code, because the mode attribute now finally really works in C, but it is
completely and silently(!) ignored by C++ code, which results in incompatible
code.
So I duplicated what is done in c/c-decl.c also in cp/decl.c. That worked
immediately, except that it is not possible to explicitly check the "mode"
attribute in the TYPE_ATTRIBUTES (enumtype) because that attribute
is never copied to the type, and the original attribute list is not available
here. That should be OK, as this check was added to fix pr52085 which
does not apply here, because C++ does not support enum forward
declarations.
If that patch is not appropriate for stage 4, I would at least want to emit
an attribute directive ignored warning in c++ mode. I think that could
be done in handle_mode_attribute. But fixing that feature is cooler.
Boot-strapped and regression tested on x86_64-pc-linux-gnu.
Ok for trunk?
Thanks
Bernd.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: changelog-enum-mode.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160206/b9644486/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-enum-mode.diff
Type: text/x-patch
Size: 1340 bytes
Desc: patch-enum-mode.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160206/b9644486/attachment.bin>
More information about the Gcc-patches
mailing list