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

Douglas Gregor <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID

--- Comment #6 from Douglas Gregor <[email protected]> 2010-11-14 23:42:43 CST 
---
(In reply to comment #5)
> This testcase fails in clang++ and succeeds in gcc. You are saying that they
> both do the same thing. This doesn't make sense.
> 
> Possible solutions can be:
> 1. gcc and clang++ both succeed or both fail for me, then please provide
> versions of both.
> 2. gcc is wrong and clang++ is right, please explain why.
> 3. bug is fixed in clang++.
> 
> This case is taken from the working project that only compiles under gcc and
> not clang.

Both clang++ and g++ 4.2 reject this code in the same way, because there is no
suitable operator != for my_alloc instances. Clang and g++ both provide good
diagnostics, and the fix to your code is trivial. Just add:

    template<typename T1>
    bool operator!=(const my_alloc<T1> &other) const { return (this != &other);
} 

into the my_alloc class and it works with both compilers.

If you found some version of g++ that worked, it's probably because that
standard library version uses == rather than != on allocators.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to