diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-07-14 05:57:57 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-07-14 06:27:07 -0700 |
commit | 31dbaab57fef485412a0369a222b9c252ad2713b (patch) | |
tree | 1cdd29a5079b04f3f34dabc3495732ba43312851 /gcc/cp/class.c | |
parent | 6039cb96d1014373470a27f02e24c2c5e821a06c (diff) | |
download | gcc-31dbaab57fef485412a0369a222b9c252ad2713b.tar.gz |
c++: Comments & formatting
I found some bad formatting and misleading or incomplete comments
during my spelunking around the c++FE. May as well clean up trunk and
record what I noted.
gcc/cp/
* cp-tree.h: Correct some tree lang flag comments,
reformat some structure definitions. Note some structure
sizes. Clarify some comments.
(yyungetc): Delete. Not been a thing for some time.
* class.c (copy_fndecl_with_name): Comment.
(check_bases_and_members): Unnecessary {}.
(layout_class_type): Comment.
* cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
* decl.c: Fix some formatting & whitespace issues.
(function_requirements_equivalent_p): Note why
substitutions are needed.
* decl2.c (no_linkage_error): Note that heroics about
'typedef struct { ... };' are no longer needed.
* method.c: Whitespace.
* name-lookup.c: Whitespace.
(add_decl_to_level): Reformat a line.
(print_binding_stack): Mark as DEBUG_FUNCTION.
(has_using_namespace_std_directive_p): Delete comment.
* pt.c: Whitespace
* ptree.c: Whitespace.
* rtti.c: Whitespace & comment.
* tree.c: Comment.
* typeck.c (structural_comptypes): Add comment.
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 14380c7a08c..c49055d384e 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4708,6 +4708,10 @@ check_methods (tree t) } } +/* FN is constructor, destructor or operator function. Clone the + declaration to create a NAME'd variant. NEED_VTT_PARM_P and + OMIT_INHERITED_PARMS_P are relevant if it's a cdtor. */ + static tree copy_fndecl_with_name (tree fn, tree name, tree_code code, bool need_vtt_parm_p, bool omit_inherited_parms_p) @@ -6091,10 +6095,8 @@ check_bases_and_members (tree t) } if (LAMBDA_TYPE_P (t)) - { - /* "This class type is not an aggregate." */ - CLASSTYPE_NON_AGGREGATE (t) = 1; - } + /* "This class type is not an aggregate." */ + CLASSTYPE_NON_AGGREGATE (t) = 1; /* Compute the 'literal type' property before we do anything with non-static member functions. */ @@ -6717,6 +6719,8 @@ layout_class_type (tree t, tree *virtuals_p) indicates the total number of bits used. Therefore, rli_size_so_far, rather than rli_size_unit_so_far, is used to compute TYPE_SIZE_UNIT. */ + + /* Set the size and alignment for the new type. */ tree eoc = end_of_class (t, /*include_virtuals_p=*/0); TYPE_SIZE_UNIT (base_t) = size_binop (MAX_EXPR, |