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]

[Bug c++/56859] New: alignas() fails in template


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56859

             Bug #: 56859
           Summary: alignas() fails in template
    Classification: Unclassified
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wd11@leicester.ac.uk


The alignas attribute fails when used with a template-dependent integer
constant, as in

template<typename T>
struct alignas(2*sizeof(T)) foo { /* ... */ };

when gcc complains that "error: requested alignment is not an integer constant"
(no problem with clang++ 3.2). In a non-templated context, this construct
compiles fine.


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