简体   繁体   中英

C++ compiler template error information - tool to decode the error information

All,

Question 1
while using templates, Compiler error information is known to be very cryptic (In the sense not readily readable by a newbee eyes) - though compiler nowadays tries best to put as much information as possible during coding problem.

Is there a chance - that the error information is more better in some compilers than others? If So can you please guide me which compiler gives more clearer information.

Question 2
The problem with template code compiler error resolving is two fold - lack of experience/ability to decode the error and also some blame to the compiler not able to give only as much information as possible which can be understood by the "human logic interpretation"

Is there any tool/options in compiler to make it more readable?


PS : Currently I use gcc 4.1.2, and less often XlC_r (Version 6) and aCC (for HP)

Thanks for your input in advance.

如果您的平台由于某种原因无法支持clang ,请尝试使用STLFilt来获得合理的错误。

I have read that the Clang compiler for LLVM has good diagnostics. (But I haven't tried it myself.)

AFAIK, Comeau 's compiler should be pretty good. You can also try an online version of it. Of course, it doesn't come for free.

As for tools, there's STLFilt but it doesn't seems updated anymore.

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