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] C++2A P0683R1 - default member initializers for bit-fields (take 2)


On 09/29/2017 05:26 AM, Jakub Jelinek wrote:
Hi!

On Wed, Sep 27, 2017 at 07:55:20AM -0700, Nathan Sidwell wrote:
	1) fix the parsing bug you found and move to (ab)using
DECL_BIT_FIELD_REPRESENTATIVE

	2) the new c++2a feature

And here is the 2) patch, on top of the previous 3 ones.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.  One nit ...

--- gcc/cp/decl2.c.jj	2017-09-29 09:57:12.586423527 +0200
+++ gcc/cp/decl2.c	2017-09-29 10:24:26.864372956 +0200
@@ -978,10 +978,11 @@ grokfield (const cp_declarator *declarat
tree
  grokbitfield (const cp_declarator *declarator,
-	      cp_decl_specifier_seq *declspecs, tree width,
+	      cp_decl_specifier_seq *declspecs, tree width, tree init,
  	      tree attrlist)

The new parm needs documenting. I notice the current description of WIDTH is wonky:
  WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node.
while true, makes one wonder if it could be NULL. Feel free to make that comment saner.

thanks

nathan

--
Nathan Sidwell


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