-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
debian stretch(当前的stable版本),gcc version 6.3.0 20170516 (Debian 6.3.0-18)
编译be时报错
cstddef:51:11: error: no member named 'max_align_t' in the global namespace
经查,是老版本llvm的bug。
参考clang++ only compiles C++11 program using boost::format when -std=c++11 option is dropped,Teach Clang to provide ::max_align_t in C11 and C++11 modes.。手动在cfe/lib/Headers/stddef.h的85行之后添加
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
typedef struct {
long long __clang_max_align_nonce1
__attribute__((__aligned__(__alignof__(long long))));
long double __clang_max_align_nonce2
__attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
#define __CLANG_MAX_ALIGN_T_DEFINED
#endif
这个问题解决。但重新编译又报新的错误
clang-3.3: /home/crc/palo/thirdparty/src/llvm-3.3.src/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2695: llvm::PointerUnion<clang::Decl*, llvm::SmallVector<clang::Decl*, 4u>> clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*): Assertion `isa(D) && "declaration not instantiated in this scope"' failed.
经查,还是老版本llvm的bug。见Bug 18653 - Abort after class declaration as template argument。
建议更新一下依赖的llvm的版本。