简体   繁体   中英

How to force clang to check semantic with system(ubuntu) STL header instead of clang's

when I try to use clang++ to detect semantic My program can be compiled with gcc. when I use clang to detect semantic, I got:

error| no viable overloaded '*='

problem occurs from one header I include from open source project

std::vector<double> Hc;
checksum(H,Hc);
Hc*=1.0/mrpt::math::maximum(Hc);

I think the problem is because the clang's STLib headers are different with my Ubuntu's C++ headers, and they didn't override *= opt. I added

 -std=c++11 
 -stdlib=libc++11 
 -nodefaultlibs 

and tried this http://libcxx.llvm.org but the only error still there. Indeed, I am trying YouCompleteMe plugin in vim . This plugin only need compile semantic and without linking step. and I can't change the header. '-isystem doesn't solve the problem' What should I do to force clang to check semantic with system STL header instead of clang's?

For the records, this was indeed a bug in the headers of MRPT, which was solved recently. So, it is not the fault of clang++, in fact the newer gcc 6.0 also detected the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM