[llvm-bugs] [Bug 33719] New: Libc++ shipped math.h and -isystem breakage
llvm-bugs at lists.llvm.org
Sat Jul 8 13:18:01 PDT 2017
Bug ID: 33719
Summary: Libc++ shipped math.h and -isystem breakage
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: krejzi at email.com
CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
While compiling Qt 5.9.1, which for some reason uses -isystem /usr/include on
my Linux system, I have noticed the following issue:
clang++ will prepend /usr/include before all system search paths, including
/usr/include/c++/v1, where c++ headers and shipped math.h are located, which
means it will pick math.h from /usr/include (from GNU Glibc) if something
includes cmath (which pulls math.h).
This can be tested using the following example
return (int) isfinite(1);
$ clang++ -std=libc++ -std=c++11 test.cpp # all good
$ clang++ -std=libc++ -std=c++11 test.cpp -isystem /usr/include # all hell
/usr/bin/../include/c++/v1/cmath:313:9: error: no member named 'signbit' in the
global namespace; did you mean '__signbit'?
/usr/include/bits/mathcalls.h:375:20: note: '__signbit' declared here
__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
In file included from test.cpp:1:
/usr/bin/../include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in
the global namespace; did you mean '__fpclassify'?
/usr/include/bits/mathcalls.h:371:20: note: '__fpclassify' declared here
__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
and so on...
Linux x86_64, clang 4.0.1 built with libc++ as the default standard library
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs