This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7586: Incorrect handling of attributes in template codes
- From: gdr at nerim dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 13 Aug 2002 16:29:49 -0000
- Subject: c++/7586: Incorrect handling of attributes in template codes
- Reply-to: gdr at nerim dot net
>Number: 7586
>Category: c++
>Synopsis: Incorrect handling of attributes in template codes
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Aug 13 09:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Gabriel Dos Reis <gdr@nerim.net>
>Release: unknown-1.0
>Organization:
>Environment:
Plateform independent
>Description:
cc1plus is trying to evaluate attributes in template
code whereas the necessary information are not present
until instantiation time.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="aligned-attribute.C"
Content-Disposition: inline; filename="aligned-attribute.C"
#include <assert.h>
template<typename T>
int f()
{
typedef unsigned char type[sizeof (T)]
__attribute__((__aligned__(__alignof__(T))));
return __alignof__ (type);
}
int main()
{
assert(f<int>() == __alignof__(int));
}