public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Richard Biener <rguenther@suse.de>,
	Richard Sandiford <richard.sandiford@arm.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] vec.h, v3: Make some ops work with non-trivially copy constructible and/or destructible types
Date: Fri, 29 Sep 2023 12:07:27 +0200	[thread overview]
Message-ID: <ZRah3zHYQupE6Q64@tucnak> (raw)
In-Reply-To: <CACb0b4msiK8anSmHqzftWPYA_Mq+pqzXkejuAAOJNx+jH=6Z7g@mail.gmail.com>

On Fri, Sep 29, 2023 at 11:00:01AM +0100, Jonathan Wakely wrote:
> > +/* Destruct N elements in DST.  */
> > +
> > +template <typename T>
> > +inline void
> > +vec_destruct (T *dst, unsigned n)
> > +{
> > +  for ( ; n; ++dst, --n)
> > +    dst->~T ();
> > +}
> > +
> >  /* Control data for vectors.  This contains the number of allocated
> >     and used slots inside a vector.  */
> >
> > @@ -310,6 +338,9 @@ va_heap::release (vec<T, va_heap, vl_emb
> >    if (v == NULL)
> >      return;
> >
> > +  if (!std::is_trivially_destructible <T>::value)
> 
> Do GCC's coding standards really require a space before the template
> argument list, like for a function parameter list?
> That style doesn't seem to be used elsewhere (and is not idiomatic for
> C++ at all).

Seems it is mixed, in gcc/ subdirectory:
grep ' <[a-zA-Z]' *.h *.cc */*.h */*.cc | grep -v '#.*include' | wc -l
7143
grep '[^ ]<[a-zA-Z]' *.h *.cc */*.h */*.cc | grep -v '#.*include' | wc -l
13579

> > +  template<typename T, typename U>
> > +  struct is_trivially_copyable_or_pair<std::pair<T, U> >
> 
> The space in "> >" is only required in C++98, we don't need it in C++11.

I know, I was just following what code around used as well.  Though
admittedly that is from the days where we needed C++98 compatibility.

	Jakub


      reply	other threads:[~2023-09-29 10:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  5:03 [PATCH] vec.h: " Jakub Jelinek
2023-09-27  7:17 ` Richard Biener
2023-09-27 10:46   ` [PATCH] vec.h, v2: " Jakub Jelinek
2023-09-27 11:15     ` Richard Biener
2023-09-29  8:57       ` [PATCH] use *_grow_cleared rather than *_grow on vect_unpromoted_value Jakub Jelinek
2023-09-29  9:13         ` Richard Biener
2023-09-27 13:15     ` [PATCH] vec.h, v2: Make some ops work with non-trivially copy constructible and/or destructible types Mikael Morin
2023-09-28  9:17     ` [PATCH] vec.h, v3: " Jakub Jelinek
2023-09-28  9:30       ` Richard Biener
2023-09-29 10:00       ` Jonathan Wakely
2023-09-29 10:07         ` Jakub Jelinek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZRah3zHYQupE6Q64@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=rguenther@suse.de \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).