This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7586: Incorrect handling of attributes in template codes


>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));
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]