[LLVMdev] Users of llvm::error_code all inherit from _do_message

Justin Bogner mail at justinbogner.com
Fri Mar 14 21:15:37 PDT 2014


Michael Spencer <bigcheesegs at gmail.com> writes:
>> If we want to continue using error_code the way we currently are, I
>> think the right thing to do here is to make error_category's constructor
>> protected and stop inheriting from _do_message.  Would anyone object to
>> that?
>
> Hmm, I'm not sure why error_category's constructor is private. It's
> not what the spec says.

I've changed it to public in r203998 to match the spec. I updated the
users as well.

> This change is fine, but we should eventually move over to
> std::{error_code,error_category}. We'll need to investigate first how
> to properly handle windows_error though, I believe that on MSVC the
> system_category properly maps to the Windows error codes. Not sure how
> MinGW handles it though.

I don't have MSVC or mingw to test with, so I'm not comfortable making
the change, but now that we've switched to C++11 we should certainly
look into switching to std:: for this.



More information about the llvm-dev mailing list