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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-19
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-19 
19:48:39 UTC ---
In the
      if (LAMBDA_TYPE_P (ctype)
          && (sfk == sfk_constructor
              || sfk == sfk_copy_assignment))
        {
          *deleted_p = true;
          return;
        }
case synthesized_method_walk doesn't initialize *trivial_p and *constexpr_p.
While the caller clears constexpr_p in that case:
  /* Don't bother marking a deleted constructor as constexpr.  */
  if (deleted_p)
    constexpr_p = false;    
...
it doesn't clear trivial_p (nor set) and uses it in:
  if (!trivial_p && type_has_trivial_fn (type, kind))
    type_set_nontrivial_flag (type, kind);

So, to fix this, either synthesized_method_walk should in that case initialize
*trivial_p (either to false or true, or conditionally, depending on what is
right), or the caller should do the same (can it do it for all deleted_p types,
not just the lambda ctors/copyctors?), or the if (!trivial_p && should also
guarded with !deleted_p.
Jason?

Reply via email to