c++ - why doesn't clang++ compile the following code? -


i have following code:

#include <type_traits>  int main() { } 

g++ file.cc -std=c++0x

works fine.

however, need use clang++ reason.

when try

clang++ file.cc -std=c++0x

i bunch of errors:

in file included file.cc:1: in file included /usr/include/c++/4.4.4/type_traits:50: /usr/include/c++/4.4.4/tr1_impl/type_traits:230:41: error: expected ')'     struct is_function<_res(_argtypes......)>                                         ^ /usr/include/c++/4.4.4/tr1_impl/type_traits:230:28: note: match '('     struct is_function<_res(_argtypes......)>                            ^ /usr/include/c++/4.4.4/tr1_impl/type_traits:230:12: error: redefinition of 'is_function<type-parameter-0-0 (type-parameter-0-1, ...)>'     struct is_function<_res(_argtypes......)>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/4.4.4/tr1_impl/type_traits:227:12: note: previous definition here     struct is_function<_res(_argtypes...)>            ^ /usr/include/c++/4.4.4/tr1_impl/type_traits:233:29: error: type qualifier not allowed on function     struct is_function<_res(_argtypes...) const> .... 

clang++ --version gives:

clang version 2.8 (branches/release_28) target: x86_64-redhat-linux-gnu thread model: posix 

any ideas how fix that? (-std=c++11 doesn't work, not recognized.)

clang 2.8 not support c++11 features, need upgrade compiler use them.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -