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

             Bug #: 51316
           Summary: alignof doesn't work with arrays of unknown bound
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ts...@mail.ru


gcc 4.7.0 rejects the following code:

    int main()
    {
        // error: invalid application of '__alignof__' to incomplete type 'int
[]'
        alignof(int []);
    }

5.3.6/1:

    An alignof expression yields the alignment requirement of its operand type.
The operand shall be a type-id representing a complete object type or an array
thereof or a reference to a complete object type.

int[] is array of complete object type.

Reply via email to