[LLVMbugs] [Bug 15511] New: alignof(function type) should be 1, as per gcc extension

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 14 07:00:00 PDT 2013


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

            Bug ID: 15511
           Summary: alignof(function type) should be 1, as per gcc
                    extension
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gribozavr at gmail.com
                CC: llvmbugs at cs.uiuc.edu, richard-llvm at metafoo.co.uk
    Classification: Unclassified

Currently clang implements alignof(function type) to be 4. 
(ASTContext.cpp:1328)

Unfortunately, this differs from the actual gcc behavior.

$ cat /tmp/zz.cc
static_assert(alignof(void(void)) == 1, "alignof(function type) should be 1");
$ g++ -fsyntax-only -std=c++11 /tmp/zz.cc
$

How do we fix this?  The obvious fix is trivial, but consequences could be
subtle, so I filed a bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130314/21621926/attachment.html>


More information about the llvm-bugs mailing list