https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93389
Bug ID: 93389
Summary: Failure to detect UB in constexpr context
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: klaus.doldinger64 at googlemail dot com
Target Milestone: ---
The following test as IIFE should be detected as UB, but it isn't:
constexpr auto test3 = []{
int* p{};
{
int x{};
p = &x;
}
return *p; // should be UB, but isn't detected
}(); // IIFE
int main() {}