Skip to content

llvm 3.3有bug #16

Description

@crcc

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 droppedTeach 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的版本。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/fixCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions