Bug 1120995

Summary: [PATCH] Fixes clang's "no member named 'max_align_t' error with gcc 4.9's cstddef
Product: [Fedora] Fedora Reporter: Andrew Gunnerson <accounts+fedora>
Component: llvmAssignee: Nobody's working on this, feel free to take it <nobody>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: ajax, bos, dmalcolm, jv+fedora, petersen, scottt.tw
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-26 01:33:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Upstream fix http://reviews.llvm.org/rL201729 none

Description Andrew Gunnerson 2014-07-18 06:08:53 UTC
Created attachment 918972 [details]
Upstream fix http://reviews.llvm.org/rL201729

Description of problem:

After gcc was updated to 4.9, clang is no longer able to compile cstddef. For example, this simple program:

--------------------------------
#include <boost/format.hpp>

int main(int argc, char **argv[]) {
    auto s = boost::format("");
    return 0;
}
--------------------------------

compiled with "clang++ -std=c++11 test.cpp" results in the following error:

--------------------------------
In file included from test.cpp:1:
In file included from /usr/include/boost/format.hpp:19:
In file included from /usr/include/boost/detail/workaround.hpp:41:
In file included from /usr/include/boost/config.hpp:40:
In file included from /usr/include/boost/config/select_stdlib_config.hpp:18:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.9.0/../../../../include/c++/4.9.0/cstddef:51:11: error: 
      no member named 'max_align_t' in the global namespace
  using ::max_align_t;
        ~~^
test.cpp:3:5: error: second parameter of 'main' (argument array) must be of type
      'char **'
int main(int argc, char **argv[]) {
    ^
2 errors generated.
--------------------------------


Version-Release number of selected component (if applicable):

gcc-4.9.0-15.fc21.x86_64
clang-3.4-11.fc21.x86_64


Additional info:

This has already been fixed upstream at http://reviews.llvm.org/rL201729 and it applies cleanly to the clang-3.4 sources. I've attached a copy of the upstream diff to this bug report.

(More info at Arch Linux bug tracker too: https://bugs.archlinux.org/task/40229)

Comment 1 Adam Jackson 2014-11-19 16:28:22 UTC
Reassign to nobody@.  I have no time and no interest in working on clang, and the only reason it's even in the llvm package is because it can't be built any other way.

If anyone wishes to volunteer for comaintainer with a focus on clang, please let me know (preferably with direct email, if it's in bz I'll likely miss the request), I'll be happy to hook you up.

Comment 2 Jan Včelák 2014-12-26 01:33:31 UTC

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