http://llvm.org/bugs/show_bug.cgi?id=13716

             Bug #: 13716
           Summary: alignas is accepted on typedefs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Clang accepts the following ill-formed code:

    typedef char alignas(int) A;
    typedef char alignas(3) B;

This is invalid per 7.6.2[dcl.align]p1:

    "An alignment-specifier may be applied to a variable or to a class data
member ... An alignment-specifier may also be applied to the declaration of a
class or enumeration type. ..."

GCC 4.7 correctly rejects these constructs (though without the most elegant
diagnostics):

    alignas.cpp:1:27: error: expected initializer before ‘A1’
    alignas.cpp:2:21: error: typedef ‘alignas’ is initialized (use decltype
instead)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to