Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using __builting_assume with Clang makes linker fail to resolve mch::vtblmap<mch::type_switch_info>::update(long) #55

Open
solodon4 opened this issue Mar 19, 2016 · 0 comments
Assignees
Labels

Comments

@solodon4
Copy link
Owner

This is not a Mach7 bug per se, likely an Apple one, but this tracks the fact that the use of __builtin_assume is currently commented out for clang. This started happening after installing Xcode 7.0.1 but I seem to have the same issue now while trying this on Ubuntu (see build log)

The reduced repro is:

typedef long intptr_t;
namespace mch {

template <typename T> class vtblmap
{
    struct A
    {
        bool is_full() ;
    };
public:
    T& update(intptr_t );
    intptr_t get_vtbl;
    void  get( )
    {
        update(get_vtbl);
    }
    A* descriptor;
};

template <typename T> T& vtblmap<T>::update(intptr_t vtbl)
{
    __builtin_assume(descriptor->is_full())     ; // Comment this out for the linker error to disappear
}

struct type_switch_info ;
class B {
    public:
    static long choose(  )
    {
        vtblmap<type_switch_info> a;
        a.get();
    }
};
}

template<    class S, class T> void  lift_ex2(int , S , T )
{
    mch::B::choose;
}

int b,  c   ;
void  my_g( )
{
    lift_ex2(c,b,my_g);
}
@solodon4 solodon4 added the bug label Mar 19, 2016
@solodon4 solodon4 self-assigned this Mar 19, 2016
solodon4 added a commit that referenced this issue Mar 19, 2016
…lt in a linker error. This is tracked by issue #55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant