Bug 55382 - Constant class member as alignment specifier
Summary: Constant class member as alignment specifier
Status: RESOLVED DUPLICATE of bug 53017
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-18 18:20 UTC by Artem Anisimov
Modified: 2015-03-25 19:09 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Anisimov 2012-11-18 18:20:22 UTC
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.
Comment 1 Marc Glisse 2012-11-18 22:13:37 UTC
Seems related to PR 53017.
Comment 2 Paolo Carlini 2015-03-25 19:09:30 UTC
Also fixed.

*** This bug has been marked as a duplicate of bug 53017 ***