CLANG vs. GNU Compilers Collection - Compiles in GNU but fails in CLANG

283 views Asked by At

I am trying to compile my project with 3rd party lib "ACE 6.2.8" in MAC OS X 10.9.5 Mavericks with clang++.

I get the following error:

In file included from ../../../Client/Chromodoris/Agent/CacheGenerator.cpp:15:
In file included from ../../../Client/Chromodoris/Agent/ACEIncludes.h:22:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/OS.h:53:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Cleanup.h:30:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Intrusive_List.h:128:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Intrusive_List.inl:5:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4013:35: error: no viable overloaded '='
            __e->__weak_this_ = *this;
            ~~~~~~~~~~~~~~~~~ ^ ~~~~~

Is it possible that CLANG++ compiler have a problem? Is there any workaround?

Additional info:

Moamen-MacBook:ace Moamen$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Please notice my code is calling 3rd party lib (ACE) which calls the CLANG++ toolchain where the problem occurs.

Notice same code compiles under the GNU Compiler collection. I believe this issue is relevant: which of these compilers has a bug, according to the standard?

1

There are 1 answers

0
MK3 On BEST ANSWER

I found a workaround.

I got a note message, 2-3 lines after the error above (sorry, don't have the message!), telling me that can't cast from base to derived class.

Use the derived class object instead of the base class object, and issue should be solved. Notice - you may use the base class instead of the derived, but depends on you implementations and needs.