[llvm-bugs] [Bug 49321] New: forming reference to nullptr is not rejected in constexpr

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 22 13:54:27 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49321

            Bug ID: 49321
           Summary: forming reference to nullptr is not rejected in
                    constexpr
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldalessandro at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

I think this UB should be rejected.

```
constexpr bool foo(int* i) {
    int& j = *i;
    return true;
}

static_assert(foo(nullptr));
```

https://godbolt.org/z/cKo3jf

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210222/bcee7962/attachment.html>


More information about the llvm-bugs mailing list