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



             Bug #: 55382

           Summary: Constant class member as alignment specifier

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: aanisi...@inbox.ru





Consider the following sample code:



struct A

{

        static const unsigned alignment = 32;



        char data[1234] __attribute__((aligned(alignment /*+ 0*/)));

} __attribute__((aligned(A::alignment /* + 0 */)));



g++ (r193606) complains that "requested alignment is not an integer constant",

but when the "+ 0" part is uncommented, the requested alignment magically

becomes a constant.

Reply via email to