From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11784 invoked by alias); 24 Apr 2003 12:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11755 invoked by uid 71); 24 Apr 2003 12:16:01 -0000 Resent-Date: 24 Apr 2003 12:16:01 -0000 Resent-Message-ID: <20030424121601.11754.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, rguenth@tat.physik.uni-tuebingen.de Received: (qmail 10248 invoked by uid 48); 24 Apr 2003 12:10:13 -0000 Message-Id: <20030424121013.10247.qmail@sources.redhat.com> Date: Thu, 24 Apr 2003 12:16:00 -0000 From: rguenth@tat.physik.uni-tuebingen.de Reply-To: rguenth@tat.physik.uni-tuebingen.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10479: __alignof__(double) not compile time constant inside template class X-SW-Source: 2003-04/txt/msg01027.txt.bz2 List-Id: >Number: 10479 >Category: c++ >Synopsis: __alignof__(double) not compile time constant inside template class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Apr 24 12:16:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Richard Guenther >Release: from 2.95 throughout 3.4 >Organization: >Environment: ia32 linux-gnu >Description: __alignof__(double) or any other not-dependend type is rejected as being not compile-time constant in a template class. Like: template struct foo2 { float bar __attribute__((aligned(__alignof__(double)))); }; while in a non-template context (just omit the template from the above example), it is accepted. Also specifying 8 rather than __alignof__(double) is ok. bellatrix:~/src/tests$ g++ -c attribute.cpp attribute.cpp:7: requested alignment is not a constant While of course __alignof__ is a gnu extension this behavior may be "correct", but it is surely not what one would expect and undocumented. >How-To-Repeat: >Fix: A workaorund is to use a configure check for the alignment and create a #define for the actual constant. >Release-Note: >Audit-Trail: >Unformatted: