Std :: nothrow does not work properly - the condition is always false

#include <iostream>


int main() {


    int *xx = new (std::nothrow) int[2];

    if(xx == NULL)
    {
        exit(1);
    }

    return 0;
}

I try to use it nothrow, but clion says xx == NULLthat the “Condition is always false” and exit(1)that “Unreachable code”. What am I doing wrong?

+4
source share
1 answer

This is a bug in CLion - CPP-989

+2
source

All Articles