Allow compiling with clang++ using -std=c++11 flag #2956

Merged
merged 1 commit into from Feb 27, 2014

Conversation

Projects
None yet
2 participants
Contributor

southerngs commented Feb 25, 2014

I need to use c++11 features for something I'm working on, and I usually build with clang. I had to
make a couple of changes for this to work and I thought they might also be useful for the mainline.

Patch includes changes needed for CXXFLAGS=-std=c++11 to work
with clang++.

  1. configure script should run in c++ mode when checking functions
    otherwise clang++ gives an error.

2)typeof operator doesn't work in c++11 mode with clang++. But
__typeof__ is a valid replacement.

Owner

dbussink commented Feb 25, 2014

Which version of clang are you using? We also run CI on Travis against clang / clang++, it is the default compiler on OS X and also the latest 3.4 has been testing. I'm wondering which version you're using that shows these issues.

Contributor

southerngs commented Feb 25, 2014

I'm using clang 3.3 compiled from source on Ubuntu 12.04. Normally it is fine, but when I passed in the flag -std=c++11 there were some errors with the configure script and compiling.

Owner

dbussink commented Feb 26, 2014

@southerngs I've done some cleanup of the Bignum parts here, could you rebase this against master so we can merge it?

Allow compiling with clang++ using -std=c++11 flag
configure script should run in c++ mode when checking functions
otherwise clang++ gives an error.
Contributor

southerngs commented Feb 26, 2014

@dbussink I did the rebase. Since you cleaned up Bignum the only change now is in the configure script so that it treats the input as C++ files instead of C.

dbussink added a commit that referenced this pull request Feb 27, 2014

Merge pull request #2956 from southerngs/configure-clang-cpp11-fix
Allow compiling with clang++ using -std=c++11 flag

@dbussink dbussink merged commit 27106e4 into rubinius:master Feb 27, 2014

1 check passed

default The Travis CI build passed
Details
Owner

dbussink commented Feb 27, 2014

@southerngs Thanks!

I did the cleanup mostly because that code seemed to be useless anyway, so I'd rather remove it than trying to work around behavior differences between C++ modes in clang :).

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