[cfe-dev] error: cannot initialize a variable of type 'NSBitmapImageFileType' with an rvalue of type 'nullptr_t'

Jim Porter jvp4846 at g.rit.edu
Mon Apr 20 16:58:54 PDT 2015


On 4/20/2015 5:52 PM, Jack Howarth wrote:
> Richard,
>          While removing the initialization of imageFileType with nil
> compiles under clang 3.6.0svn, the compilation now emits warnings later
> in the file...
[snip]
> So you are saying that under -std=c++11, it is impossible to initialize
> the strongly typed enum imageFileType in order to suppress these warnings?

You should probably explicitly initialize it to an appropriate value or 
fix the code to not use it in the case clang is warning about, but it's 
not hard to initialize a strongly-typed enum to *something*:

   MyEnum value{};

- Jim





More information about the cfe-dev mailing list