Opened 3 years ago
Last modified 6 months ago
#62770 closed defect
clang++ 11 broken by MacOS 11.3 update — at Initial Version
Reported by: | haberg-1 (Hans Åberg) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | bigsur x86_64 | Cc: | |
Port: | clang-11 |
Description
The update to MacOS 11.3 and Xcode 12.5, with Command Line Tools, broke clang++ 11: It can not find system headers such as wchar.h, it seems. Unclear with workarounds. Curiously, g++ 10 works.
Specifically, /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world produces the errors below, whereas /opt/local/bin/g++-mp-10 hello_world.cc -o hello_world works.
— % /opt/local/bin/clang++-mp-11 hello_world.cc -o hello_world In file included from hello_world.cc:2: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:95: /opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:137:77: error: use of undeclared identifier 'wcschr' wchar_t* libcpp_wcschr(const wchar_t* s, wchar_t c) {return (wchar_t*)wcschr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:144:87: error: use of undeclared identifier 'wcspbrk' wchar_t* libcpp_wcspbrk(const wchar_t* s1, const wchar_t* s2) {return (wchar_t*)wcspbrk(s1, s2);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:151:78: error: use of undeclared identifier 'wcsrchr'; did you mean 'wcschr'? wchar_t* libcpp_wcsrchr(const wchar_t* s, wchar_t c) {return (wchar_t*)wcsrchr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:139:16: note: 'wcschr' declared here const wchar_t* wcschr(const wchar_t* s, wchar_t c) {return libcpp_wcschr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error: use of undeclared identifier 'wcsstr'; did you mean 'wcschr'? wchar_t* libcpp_wcsstr(const wchar_t* s1, const wchar_t* s2) {return (wchar_t*)wcsstr(s1, s2);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note: 'wcschr' declared here
wchar_t* wcschr( wchar_t* s, wchar_t c) {return libcpp_wcschr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:86: error: no matching function for call to 'wcschr' wchar_t* libcpp_wcsstr(const wchar_t* s1, const wchar_t* s2) {return (wchar_t*)wcsstr(s1, s2);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:16: note: candidate disabled: <no message provided>
wchar_t* wcschr( wchar_t* s, wchar_t c) {return libcpp_wcschr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:158:93: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'const wchar_t *' wchar_t* libcpp_wcsstr(const wchar_t* s1, const wchar_t* s2) {return (wchar_t*)wcsstr(s1, s2);}
~
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:141:38: note: passing argument to parameter 's' here
wchar_t* wcschr( wchar_t* s, wchar_t c) {return libcpp_wcschr(s, c);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:165:60: error: unknown type name 'size_t' wchar_t* libcpp_wmemchr(const wchar_t* s, wchar_t c, size_t n) {return (wchar_t*)wmemchr(s, c, n);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:167:57: error: unknown type name 'size_t' const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n) {return libcpp_wmemchr(s, c, n);}
/opt/local/libexec/llvm-11/bin/../include/c++/v1/wchar.h:169:57: error: unknown type name 'size_t'
wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n) {return libcpp_wmemchr(s, c, n);}
In file included from hello_world.cc:2: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:214: /opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:189:14: error: use of undeclared identifier 'mbstate_t' typedef fpos<mbstate_t> streampos;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:190:14: error: use of undeclared identifier 'mbstate_t' typedef fpos<mbstate_t> wstreampos;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:195:14: error: use of undeclared identifier 'mbstate_t' typedef fpos<mbstate_t> u16streampos;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/iosfwd:196:14: error: use of undeclared identifier 'mbstate_t' typedef fpos<mbstate_t> u32streampos;
In file included from hello_world.cc:2: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/locale:14: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:57: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:46: /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:49:9: error: no member named 'ptrdiff_t' in the global namespace using ::ptrdiff_t;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:50:9: error: no member named 'size_t' in the global namespace using ::size_t;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/cstddef:53:9: error: no member named 'max_align_t' in the global namespace using ::max_align_t;
In file included from hello_world.cc:2: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/iostream:37: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/ios:215: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/locale:14: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:506: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string_view:175: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/string:57: In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/algorithm:639: /opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:61:5: error: unknown type name 'size_t'
size_t size_;
/opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:65:38: error: unknown type name 'size_t'
initializer_list(const _Ep* b, size_t s) _NOEXCEPT
/opt/local/libexec/llvm-11/bin/../include/c++/v1/initializer_list:73:13: error: unknown type name 'size_t'
typedef size_t size_type;
fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. —
Includes <iostream> and calls std::cout to trigger the issue.