From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32278 invoked by alias); 19 May 2009 17:58:04 -0000 Received: (qmail 32244 invoked by uid 48); 19 May 2009 17:57:53 -0000 Date: Tue, 19 May 2009 17:58:00 -0000 Message-ID: <20090519175753.32243.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40192] [4.4/4.5 Regression] Unable to use std::vector with typedef'd array types In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "coleb at eyesopen dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg01645.txt.bz2 ------- Comment #11 from coleb at eyesopen dot com 2009-05-19 17:57 ------- (In reply to comment #10) > Look closely at the patch I committed, I changed *nothing* of the actual > behavior of the containers. Thus the semantics is exactly the same as before, > only, the destructor in not called explicitly anymore on such element type, > because the destructor is trivial. > Yup, even though you can declare a vector, you can't do anything useful with it. typedef float cl_float4[4] __attribute__((aligned(16))); #include int main() { std::vector vals(1); cl_float4 a = {1.0f, 2.0f, 3.0f, 4.0f}; vals.push_back(a); } /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:412: error: ISO C++ forbids assignment of arrays Does seem strange to allow vector to be compilable, but eh, lesson learned, stay away from array types in C++. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40192