From dev-return-8001-apmail-stdcxx-dev-archive=stdcxx.apache.org@stdcxx.apache.org Thu Jun 26 20:51:27 2008 Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 90450 invoked from network); 26 Jun 2008 20:51:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jun 2008 20:51:27 -0000 Received: (qmail 59188 invoked by uid 500); 26 Jun 2008 20:51:29 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 59174 invoked by uid 500); 26 Jun 2008 20:51:29 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 59163 invoked by uid 99); 26 Jun 2008 20:51:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 13:51:28 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 20:50:39 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m5QKoulX031797 for ; Thu, 26 Jun 2008 20:50:56 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: question about aligned_storage Date: Thu, 26 Jun 2008 14:50:21 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: question about aligned_storage Thread-Index: AcjXzAsNor6wFuW2SbSTELvWukA+ZwAAefjA References: <48618975.7070800@roguewave.com> <4861BCF0.30108@roguewave.com> <4863BDEB.1090606@roguewave.com> <4863E9E2.80509@roguewave.com> <4863FCF9.2050103@roguewave.com> From: "Travis Vitek" To: X-Virus-Checked: Checked by ClamAV on apache.org =20 Martin Sebor wrote: > >Travis Vitek wrote: >> >> Here is a testcase... >>=20 >> $ cat z.cpp && g++ --version && g++ -c z.cpp >>=20 >> template >> struct __rw_aligned_storage {=20 >> typedef struct { >> char _C_align [N] __attribute__ ((aligned (A))); >> } type; >> }; >>=20 >> __rw_aligned_storage<10, 4>::type aligned_t; >>=20 [...] >>=20 >> z.cpp: In instantiation of '__rw_aligned_storage<10, 4>::type': >> z.cpp:9: instantiated from here >> z.cpp:5: error: requested alignment is not a constant >>=20 >> If I can't access the member type 'type', then the feature=20 >> is useless. The nested type is the only thing that is aligned. >> If you are sure that this will work with gcc-4.3, please show >> me where I've gone wrong. > >Isn't it obvious? You're missing a set of parentheses around A ;-) >This works for me: > > template > struct __rw_aligned_storage { > typedef struct { > char _C_align [N] __attribute__ ((aligned ((A)))); > } type; > }; > > __rw_aligned_storage<10, 4>::type aligned_t; > >>=20 >> Travis >> Darn you Martin Sebor! Well now that I have a workaround, I can do it the easy way (on one compiler). Travis