From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19293 invoked by alias); 11 Jun 2012 18:50:54 -0000 Received: (qmail 19282 invoked by uid 22791); 11 Jun 2012 18:50:53 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from chihiro.randombit.net (HELO chihiro.randombit.net) (69.48.226.76) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jun 2012 18:50:39 +0000 Received: by chihiro.randombit.net (Postfix, from userid 1000) id 7540B124864E; Mon, 11 Jun 2012 14:50:38 -0400 (EDT) Date: Mon, 11 Jun 2012 18:50:00 -0000 From: Jack Lloyd To: Jonathan Wakely Cc: gcc-help@gcc.gnu.org Subject: Re: std::vector<__m128i> with non-standard allocators Message-ID: <20120611185038.GN28623@randombit.net> References: <20120611174448.GM28623@randombit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Fingerprint: 3F69 2E64 6D92 3BBE E7AE 9258 5C0F 96E8 4EC1 6D6B X-PGP-Key: http://www.randombit.net/pgpkey.html User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00103.txt.bz2 On Mon, Jun 11, 2012 at 06:57:05PM +0100, Jonathan Wakely wrote: > The C++ standard says that in a psuedo-destructor call (i.e. an > expression like p->~U() for a non-class type) the operand shall be a > scalar type, which would seem to rule out vector types (but then the > standard says nothing about them anyway.) Thanks, I had no realized that the standard allows that for scalar types. > You could either specialize the allocator's destroy function for the > case of __m128i so it does nothing, or file a bug asking for > pseudo-destructor calls to be allowed on types like __m128i. I considered specialization but that requires me to guess what vector types someone might want to use (the various AVX, NEON, and AltiVec types all seem reasonable in the context of the allocator I'm writing) and additionally pollute the namespace by pulling in headers to find the definitions, so I was hoping for another approach. It's definitely pretty unfortunate that this is rejected in that it seems (?) like the intent of the pseudo-destructor syntax is to ensure that p->~U() is always well formed precisely to allow uniform syntax for cases like this. I suppose I'll file a bug and hope that people working on the C++ FE agree this is a reasonable thing to support. It looks like Clang 3.1 also rejects, Intel C++ 12.1 and Visual C++ 2010 accepts. Not sure about Comeau as the online compiler doesn't seem to know about emmintrin.h -Jack