Below are two test-cases for Undefined Behaviour, expressed as IIFE (Immediately Called Lambda-Axpression):
constexpr auto test3 = []{
    int* p{};
    {   
        int x{};
        p = &x;
    }
    return *p; // Undefined Behaviour
}(); // IIFE
constexpr auto test4 = []{
    int x = std::numeric_limits<int>::min();
    int y = -x;  // Undefined Behaviour
    return y;
}();
int main() {}
When compiled with GCC trunk, test4 is correctly rejected as it exhibs Undefined Behaviour in a constexpr. On the other hand test3 is accepted.
Is GCC right to accept test3?
 
    