C++ Logo

std-discussion

Advanced search

Re: Indirection of nullptr that is not really done

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 23 Jun 2024 17:30:34 -0700
On Saturday 22 June 2024 11:18:09 GMT-7 Jens Maurer via Std-Discussion wrote:
> Compilers need to track values for constant evaluation.
> Having a consistent check for nullptr at the time *p is
> evaluated seems pretty simple.

That assumes they even see it. If the constexpr interpreter is reusing the
same AST as the regular compiler, it's possible the pointer dereferencing has
already been eliminated by the time this runs.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-06-24 00:30:40