• Advertisement
Sign in to follow this  

Clang Asgettypetraits

This topic is 640 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm guessing this is a bug, so I'm marking it as one.

Compiling on MSVC and GCC are fine, but when you try to compile 2.31.1 on clang (via CMake in my case), you get an error about std::has_trivial_destructor not existing. This is on clang 3.8 on Ubuntu 16.04.

If I add defined(__clang__) to the first block (for "MSVC, Xcode/clang, and gnuc 5+"), it builds and runs fine.

Share this post


Link to post
Share on other sites
Advertisement

Hah, had exactly the same problem on Ubuntu, spent several hours trying to figure out why my environment is incorrect (had other problems along the way, with standard headers not being found for clang with C++11 defined and so on), and I ended up with the same solution, adding __clang__ check to that condition, as for clang GNUC was reported as 4.2 (even though headers used were 5.0+), and somehow it didn't define _LIBCPP_TYPE_TRAITS either.

 

Good to know my temporary fix was the right thing to do :) Wish I waited a bit and actually see this post rather than spend so much time trying to fix what I thought was wrong Clang installation on Ubuntu. 

Edited by noizex

Share this post


Link to post
Share on other sites

Whether or not it is the right thing to do only the future will tell :).

 

Making code compile without warnings/errors on all types of compilers is difficult, especially as the compilers themselves evolve and change how they handle things. What works today, may very work stop working when a new version of compiler X or Y is released. Or else, someone is stuck using an older compiler, and a backwards compatibility mode is needed in the code.

 

Luckily it is usually only minor tweaks that are needed, and can easily be fixed as soon as someone identifies that there is a problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement